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++.
0 · ·