Hello!
I just encountered a very strange problem: I'm trying to use JDBC in my Tomcat Instance by using the classForName(com.ibm.db2.jcc.DB2Driver) to load the driver.
It works perfectly well - unless the classForName Code is in a .jar File I created remotely on Windows - I get a ClassNotFoundException. There is no problem with a .class File I compile on Windows and transfer via FTP.
Jars created on z/os issue no problems neither.
Strange, isn't it?
Any Idea?
Thanks!
Alex
classForName(com.ibm.db2.jcc.DB2Driver) and external jars
... it's the classpath, stupid ;-)
After hours of trying it out, I finally found the reason:
1) When trying to load a jdbc driver form a class file that is within a .jar file from the commandline, only the classpath in the manifest is considered.
2) In combination with Tomcat, I had to put the drivers (db2jcc.jar, db2jcc_javax.jar, db2jcc_license_cisuz.jar) in the TOMCAT_HOME/common/lib directory. Any other directory did not work out.
Hope that may help others, too.
Alex
1) When trying to load a jdbc driver form a class file that is within a .jar file from the commandline, only the classpath in the manifest is considered.
2) In combination with Tomcat, I had to put the drivers (db2jcc.jar, db2jcc_javax.jar, db2jcc_license_cisuz.jar) in the TOMCAT_HOME/common/lib directory. Any other directory did not work out.
Hope that may help others, too.
Alex