I try to connect from my Java-Application to an existing DB2 Database. My Code looks like a minimal version of the example shown at connect DB2 with Java.
public static void main(String[] argv) {
try {
Class.forName("com.ibm.db2.jcc.DB2Driver");
}
catch (ClassNotFoundException e) {
System.out.println("Please include Classpath Where your DB2 Driver is located");
e.printStackTrace();
return;
}
System.out.println("DB2 driver is loaded successfully");
}
When i run this the following error occurs:
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
What are the requirements to connect to a DB2? I added db2jcc.jar and db2jcc_licence_cisuz.jar to the projects build-path and inside the db2jcc.jar exists an DB2Driver.class.
Do I have to configure sth. else?
/com/ibm/db2/jcc
? – JB Nizet Aug 17 '13 at 13:41