| Author |
how to connect mysql database?
|
Markandey Sahu
Greenhorn
Joined: Jun 29, 2006
Posts: 13
|
|
Can any one give me code for connecting mysql database? Wich driver we can use for connecting database. pls give me complete code.. Class.forName("???"); Connection con =DriverManage.getConnection("???","??","??"); what i have to write in place of ???
|
 |
Syskata Mitev
Ranch Hand
Joined: Aug 23, 2006
Posts: 51
|
|
Class.forName("com.mysql.jdbc.Driver").newInstance(); database url : jdbc:mysql://localhost:3306/database_name and check http://www.mysql.com/products/connector/j/ for connector downloading. 4ng().live.healtly;
|
 |
Prabhu Venkatachalam
Ranch Hand
Joined: Nov 16, 2005
Posts: 502
|
|
Add your jconnector jar file to your classpath or copy it in your lib directory. driverClass: com.mysql.jdbc.Driver URL : jdbc:mysql://<serverhost:port>/<db name> For more information, here is the URL
|
Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
|
 |
 |
|
|
subject: how to connect mysql database?
|
|
|