wood burning stoves 2.0*
The moose likes JDBC and the fly likes java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver" Watch "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver" New topic
Author

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

Kee Kee moon
Ranch Hand

Joined: Dec 11, 2009
Posts: 147
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

Joined: Dec 20, 2006
Posts: 2499
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
Kee Kee moon
Ranch Hand

Joined: Dec 11, 2009
Posts: 147
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

Joined: Dec 20, 2006
Posts: 2499
    
    8

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

Joined: Dec 11, 2009
Posts: 147
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

Joined: Dec 20, 2006
Posts: 2499
    
    8

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

Joined: Dec 11, 2009
Posts: 147
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

Joined: Dec 20, 2006
Posts: 2499
    
    8

Cool. Thank you for posting your solution.

Regards, Jan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver