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!

how to run jar file with external library ojdbc6.jar

879562Aug 1 2011 — edited Oct 15 2014
Hi, I wrote a simple program in JDeveloper to connect to Oracle database 11g. And I included ojdbc6.jar as Jar file in the project property.
Everything works fine in JDeveloper, I can get connected and do query. However, when I deployed the app to a JAR file, (Include the library dependency) it gives me the error:

Message: No suitable driver found for jdbc:oracle:thin:

I thought this may be caused because the my jar file doesn't link with the library.

I tried to remake jar by writing a manifest with Class-Path: ojdbc6.jar and run jar cfm manifest.mf app/*.class
running with -classpath option in cmd

But it doesn't work outside JDeveloper, maybe I missed something?

Anyone knows what is the problem?
Thanks so much
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2011
Added on Aug 1 2011
9 comments
2,297 views