Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

843859Nov 9 2005 — edited Nov 20 2014
I'm writing an app that connects to an Oracle database. Everything works fine when in the IDE (NetBeans by the way) but when I attempt to launch the jar file from the command-line I get the following error:

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.harris.pdm.pma.OracleConnection.connectToDatabase(OracleConnection.java:105)
at com.harris.pdm.pma.AppLogic.initLogic(AppLogic.java:87)
at com.harris.pdm.pma.AppDialog.startApplication(AppDialog.java:57)
at com.harris.pdm.pma.AppDialog.main(AppDialog.java:448)java.sql.SQLException: No suitable driver
.
.
.

From reading the other posts it seems like ojdbc14.jar is not in the classpath. But I've included ojdbc14.jar in the compile-time libraries in NetBeans. I've also tried to run the app like so:

java -classpath C:\ojdbc14.jar -jar PMA.jar

...but I still get the same error message. What's the way I need to do this so it'll work? Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2008
Added on Nov 9 2005
4 comments
516 views