cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting to mySql database from Java

Zangler
Newbie
Posts: 2
Registered: ‎30-09-2007

Connecting to mySql database from Java

I'm trying to establish a connection to mySql database from within a Java class I'm developing.  The Java statement I'm using is in the format of:
Connection con = DriverManager.getConnection(fileURL, userName, passWord);
Huh My question is: What fileURL should I use to connect to my database (it's on the rumpus server)?
1 REPLY 1
Zangler
Newbie
Posts: 2
Registered: ‎30-09-2007

Re: Connecting to mySql database from Java

Can't believe I missed it!  Wink
Of course, the fileURL is whatever name I used to register the database with the ODBC Data Source Administrator!  Providing the db is configured correctly with the mySQL ODBC driver and this picks up the rumpus.plus.net server, the connection should work.
... and it does!
Thanks to Richard G. Baldwin and his article for pointing me in the right direction:
http://www.developer.com/java/data/article.php/3417381