Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connectivity Problem with data base

 
muk kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m trying just core java connection to mysql database .but it give the error in this line
con=DriverManager.getConnection(jdbc.odbcata","root","root");

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection(jdbc.odbcata","root","root");
String query = "select max(serialno)as max from INDENT" ;
java.sql.Statement st=con.createStatement();
st.executeQuery(query);
System.out.println(st);
}
catch(Exception sq)
{
System.out.println("SQLException : "+sq);
return;
thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using the JDBC-ODBC bridge? MySQL has its own type 4 driver.

What error does it give? It's easier to answer questions if you post the error message rather than leaving us to guess which error it might be.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic