permaculture playing cards*
The moose likes JDBC and the fly likes Connectivity Problem with data base Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connectivity Problem with data base" Watch "Connectivity Problem with data base" New topic
Author

Connectivity Problem with data base

muk kumar
Greenhorn

Joined: Jun 18, 2007
Posts: 3
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

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connectivity Problem with data base
 
Similar Threads
problem while accessing class file from a package
why it is not compiling
an illigal cursor status.
an illigal cursor status.
insert statement