Home arrow static arrow Java Programming [Archive] - java and mysql
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - java and mysql
This topic has 2 replies on 1 page.

Posts:60
Registered: 3/30/04
java and mysql  
Aug 9, 2004 12:03 AM



 
I have the following problem, well actually i don't know something and that is how to set java for mysql.
I have the following:

Class.forName("sun.mysql.odbc.JbdcOdbcDriver");      Connection con = DriverManager.getConnection("jdbc:mysql:mytable",  "xxx", "xxx");  


Question: how do i proceed??

thx in advance

gr. Razorblade
 

Posts:453
Registered: 11/6/04
Re: java and mysql  
Aug 9, 2004 12:11 AM (reply 1 of 2)



 
If it's not particular for you to use jdbcodbc bridge, then,
use:

Class.forName("com.jdbc.mysql.Driver");Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/yourDB",  "username", "pwd");


ensure the mysql driver jar is on the classpath
 

Posts:964
Registered: 7/23/03
Re: java and mysql  
Aug 9, 2004 12:11 AM (reply 2 of 2)



 
try to read this...
http://dev.mysql.com/doc/connector/j/en/#id2803477
 
This topic has 2 replies on 1 page.