I am getting the following exception while trying to access connection pool for DB2 (oracle datasource works) I am using the .....app.DB2Driver available in db2java.zip available when DB2 is installed. I inatalled the driver using Admin Console of DB2. *** SQLException caught *** java.sql.SQLException: Error loading JDBC driver: COM.ibm.db2.jdbc.app.DB2Driver java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.sql.SQLException(java.lang.String) java.sql.Driver com.ibm.ejs.cm.JDBCDataSource.loadAndCheckDriver() com.ibm.ejs.cm.pool.ConnectionFactory com.ibm.ejs.cm.JDBCDataSource.createConnectionFactory() javax.sql.DataSource com.ibm.ejs.cm.DataSourceImpl.getSource() java.sql.Connection com.ibm.ejs.cm.DataSourceImpl.getConnection() void DsTest.main(java.lang.String )
Yes I had found that out was using db2java.zip from db2's directory. Problem is that the connection pool works from a servlet deployed in websphere but gives exception when I try to use connection pool from a client program in IBM Visual Age. Can anybody help in this forum?
When I execute a java program in IBM Visual Age IDE which uses connection pool in WebSphere and does pool.getConnection, following exception is thrown... (Relevant features for websphere are installed in Visual-Age IDE) java.sql.SQLException: Error loading JDBC driver: COM.ibm.db2.jdbc.app.DB2Driver java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.sql.SQLException(java.lang.String) java.sql.Driver com.ibm.ejs.cm.JDBCDataSource.loadAndCheckDriver() com.ibm.ejs.cm.pool.ConnectionFactory com.ibm.ejs.cm.JDBCDataSource.createConnectionFactory() javax.sql.DataSource com.ibm.ejs.cm.DataSourceImpl.getSource() java.sql.Connection com.ibm.ejs.cm.DataSourceImpl.getConnection() void DsTest.main(java.lang.String )
I had this exact problem after successfully connecting to a DataSource on WebSphere from VisualAge for Java v3.5.3 for weeks. Other developers with the same setup had no problems. To resolve the problem I performed the following steps: 1. Close VisualAge if it is open. 2. Rename db2java.zip to something such as db2java.zip_ so VisualAge will no longer recognize it. 3. Open VisualAge. 4. Change db2java.zip back to its original name. 5. Start the WebSphere Test Environment. This worked for me...good luck to you.
Sorry folks. I had fixed this problem previously using the steps I provided in a previous post, but the problem has returned and I cannot seem fix it. I am considering reinstalling VisualAge because no one else in my shop is experiencing this problem - and my machine is set up the same as theirs. Any other ideas???
Ed - that is strange that your VAJ reverts back to its bad habits after a period of time. I don't have a solution, but I'll take a stab at what's happening to you. Perhaps VAJ looks at an internal variable to determine the location of the driver. If that variable isn't set, it looks at some environment variable for the driver location and sets the internal variable accordingly. Now let's assume that the value of the environment variable is wrong. Next, WTE is fired up. WTE looks at the same internal variable for the driver location. If the internal variable has not been set, WTE looks at a different (correct)environment variable and sets the internal variable. If all these assumptions are correct, it would explain why the steps you took to correct the problem worked. Since VAJ couldn't see db2java.zip, it did not set the value of the internal variable. Now when WTE sees that the value of the internal variable was not set, it does its own look up and (now since you re-named the filed back to db2java.zip), it correctly sets the value of the internal variable. Are you guys buying this so far? Next, fast forward in time a few days/weeks/whatever. Something wacky happens inside VAJ/WTE that causes the value of the internal variable to be set to null. Now the process happens all over again! If this is what is actually happening, the question is why is VAJ looking in the wrong place for the value of db2java.zip??? Perhaps you have correctly set the classpath in WTE, but NOT set it in VAJ! So Ed, have you set your classpath in both Windows/system -> advanced tab ->set environment variables? How about in WTE/Servlet engine -> set environment variables? Is there another place in VAJ (not WTE) that you need to set the classpath?
Regarding my problem: I find it very strange that if I manually create a connetion, WTE can see db2java.zip but if I use the DataSource, WTE cannot see db2java.zip. I guess that means I have not correctly configured my DataSource (both in the code and in the Persistant Naming Server). Anyone care to eyeball my code (see previous posts) to determine if I'm doing something wrong there?
Still fighting WTE on this. I've pointed the following classpaths to <local DB2 client directory>\SQLLIB\java\db2java.zip (1330 kb): Windows environment classpath Servlet engine classpath VAJ workspace classpath (window->options->resources) Is there a way to explicitly set the classpath for the Persisent Name Server?