• 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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!