Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

 
Shrikumar Vadivelu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting following exception:

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

This is my CODE:
----------------

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
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);
pstmt.execute();

Kindly let me know ur suggestions asap.

Thanks & Regards,
--Sri.
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...for example it is not included in the IBM JDK which is installed and enabled by default in WebSphere.
 
Pankaj Shirke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic