• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have classes12.jar in C:\oracle\product\10.2.0\db_1\jdbc\lib\ and the classes12.jar does contain OracleDriver.class please see below. I have set the classpath environment to
C:\oracle\product\10.2.0\db_1\jdbc\lib\. But I still get an error as java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

C:\jar tvf C:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar oracle/jdbc/driver/OracleDriver.class
13666 Wed Jun 22 11:16:02 EDT 2005 oracle/jdbc/driver/OracleDriver.class


Please help.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you try to set your classpath to C:\oracle\product\10.2.0\db_1\jdbc\lib\<jdbc jar file>?

Also, check if you are using the correct jar file for your platform:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
classes12.jar is for use with JDK 1.2 and JDK 1.3

 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jan Cumps wrote:Can you try to set your classpath to C:\oracle\product\10.2.0\db_1\jdbc\lib\<jdbc jar file>?

Also, check if you are using the correct jar file for your platform:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
classes12.jar is for use with JDK 1.2 and JDK 1.3



I have download the classes12.jar from the path you provide, but still failed.

I checked my java version by issuing a command as below and it returned java version "1.6.0_18"
java -version
java version "1.6.0_18"

Should I still use oracle.jdbc.driver.OracleDriver.
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you followed my other advise: "Can you try to set your classpath to C:\oracle\product\10.2.0\db_1\jdbc\lib\<jdbc jar file>" ?

And classes12.jar is not the right jar for Oracle 10.2 with Java 1.6 (classes12.jar is for use with JDK 1.2 and JDK 1.3 ).
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jan Cumps wrote:Have you followed my other advise: "Can you try to set your classpath to C:\oracle\product\10.2.0\db_1\jdbc\lib\<jdbc jar file>" ?

And classes12.jar is not the right jar for Oracle 10.2 with Java 1.6 (classes12.jar is for use with JDK 1.2 and JDK 1.3 ).



I found something and it is interesting, see below:

jar tvf C:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar oracle\jdbc\driver\OracleDriver.class <<== with backslash it does not return anything.

jar tvf C:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar oracle/jdbc/driver/OracleDriver.class <<== it does return the OracleDriver.class
13666 Wed Jun 22 18:50:02 EDT 2005 oracle/jdbc/driver/OracleDriver.class
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That behavior is as expected and as documented.

But back to the original subject: does your code work if you add the correct jdbc .jar to your classpath, in stead of the folder where the jdbc jars are located?
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kee Kee moon wrote:

Jan Cumps wrote:Have you followed my other advise: "Can you try to set your classpath to C:\oracle\product\10.2.0\db_1\jdbc\lib\<jdbc jar file>" ?

And classes12.jar is not the right jar for Oracle 10.2 with Java 1.6 (classes12.jar is for use with JDK 1.2 and JDK 1.3 ).



I found something and it is interesting, see below:

jar tvf C:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar oracle\jdbc\driver\OracleDriver.class <<== with backslash it does not return anything.

jar tvf C:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar oracle/jdbc/driver/OracleDriver.class <<== it does return the OracleDriver.class
13666 Wed Jun 22 18:50:02 EDT 2005 oracle/jdbc/driver/OracleDriver.class




I have found the solution; I have resolved my problem. I add ojdbc14.jar into my configure path on my java application. Thanks for every who were trying to help me.
 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool. Thank you for posting your solution.

Regards, Jan
 
reply
    Bookmark Topic Watch Topic
  • New Topic