It's not a secret anymore!
The moose likes JDBC and Relational Databases 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 and Relational Databases
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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Connectivity Problem with data base
 
It's not a secret anymore!