Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to connect to MySQL database

843854Jan 3 2005 — edited Jan 3 2005
hi all,
I have MySQL database call webnmsdb at 10.1.0.155. Now I want to connect to this database from my computer. I have done this:
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(
"jdbc:odbc:http://10.1.0.155:3306/webnmsdb","bant","nhimsu");
}catch(ClassNotFoundException e){
e.printStackTrace();
}catch(SQLException e){
e.printStackTrace();
}

but It wrong, PLs tell me how to connect to this database

Thank you verry much for your help in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2005
Added on Jan 3 2005
1 comment
56 views