File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver" Watch "ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver" New topic

ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

Shrikumar Vadivelu

Joined: Sep 14, 2005
Posts: 14

I am getting following exception:

"java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver".

This is my CODE:

con = DriverManager.getConnection("jdbc dbc:gsoe", "gsoe", "gsoe");
pstmt = con.prepareStatement("insert into tmp_order (id, order_qty) values (?, ?)");
pstmt.setLong(1, dpci_id);
pstmt.setLong(2, two);

Kindly let me know ur suggestions asap.

Thanks & Regards,
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
1)check whether you have the jar file(rt.jar) in classpath accessable to jre.
2)also check whether you are using SUN JRE. If you are using other jre, ODBC bridge driver might not exist.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

...for example it is not included in the IBM JDK which is installed and enabled by default in WebSphere.
Pankaj Shirke

Joined: Sep 28, 2005
Posts: 4
If you are using Sun JRE ,then just put rt.jar in your jre\lib\ext directory or add JAVA_HOME/lib folder in your classpath.
It depends on JVM vendor.If you use jvm other than Sun you won't get JdbcOdbcDriver.
I agree. Here's the link:
subject: ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver