This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connectivity Problem with data base
 
Similar Threads
why it is not compiling
an illigal cursor status.
an illigal cursor status.
insert statement
problem while accessing class file from a package