File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kee Kee moon
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Jan Cumps
Bartender
Posts: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: 2577
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool. Thank you for posting your solution.

Regards, Jan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic