Java Jar File and DB2Driver - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Java Jar File and DB2Driver

bad_coderbad_coder Posts: 17Member
I created a simple java program to connect to a DB2 database and do some adding, updating and other database manipulation. It works fine, until a make a executable jar file. I keep getting the following error message:

C:projectsjava>java -jar databasemanip.jar ADD_ROW
Exception in thread "main" java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)

As I said before, it works if I do this when it is not in a jar file:

C:projectsjavaHtmlAutomation>java lab9_jdbc.BuildAndAccessDataBase ADD_ROW
Database Driver Loaded.

Any help would be great. I am a bit new to java, but very good at C++.

Thanks!
Sign In or Register to comment.