Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 91775 invoked from network); 3 Apr 2003 09:40:25 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 3 Apr 2003 09:40:25 -0000 Received: (qmail 14986 invoked by uid 97); 3 Apr 2003 09:42:26 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 14979 invoked from network); 3 Apr 2003 09:42:26 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 3 Apr 2003 09:42:26 -0000 Received: (qmail 90369 invoked by uid 500); 3 Apr 2003 09:40:06 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 90351 invoked from network); 3 Apr 2003 09:40:05 -0000 Received: from unknown (HELO cctinet.concatel.com) (212.9.69.77) by daedalus.apache.org with SMTP; 3 Apr 2003 09:40:05 -0000 Received: (qmail 3893 invoked from network); 3 Apr 2003 09:38:43 -0000 Received: from unknown (HELO cctnotes.bcn.concatel.com) (192.168.1.249) by cctinet.concatel.com with SMTP; 3 Apr 2003 09:38:43 -0000 Subject: Re: Cannot load JDBC Driver class com.ibm.db2.jdbc.app.DB2Driver To: "Tomcat Users List" Bcc: X-Mailer: Lotus Notes Version 5.0.2c (Esp.) 8 febrero del 2000 Message-ID: From: gilad.buzi@bcn.concatel.com Date: Thu, 3 Apr 2003 11:37:49 +0200 X-MIMETrack: Serialize by Router on cctnotes/CONCATEL(Release 5.0.4 |June 8, 2000) at 03/04/2003 11:37:50 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N try using the com.ibm.db2.jdbc.net.DB2Driver . (instead of the ...app.DB2Driver.) it's a thin client that doesn't require finding libraries locally... url would be something like: jdbc:db2//localhost/db_name or if you use a non-standard port and use an ip address instead of a hostname: jdbc:db2//192.168.1.123:9993/db_name /gilad =20 Gilad Buzi =20 R&D Engineer =B7 CONCATEL =20 =20 =20 gilad.buzi@bcn.concatel.com =20 c/Sardenya, 229-237 Atic. 2a =B7 =20 08013 Barcelona Spain =20 tel. +34.93.244.88.77 =B7 fax =20 +34.93.244.88.78 =20 =20 www.concatel.com =20 =20 = =20 Stephen = =20 Peterson Para: tomcat-user@jakarta.ap= ache.org =20 Asunto: Cannot load JDBC = Driver class com.ibm.db2.jdbc.app.DB2Driver =20 = =20 02/04/2003 = =20 12:28 = =20 Por favor, = =20 responda a = =20 "Tomcat Users = =20 List" = =20 = =20 = =20 Hello, I'm getting this java.sql.SQLException when trying to open a connection on my datasource. The WebSphere Test Environment datasource opens connections fine, but not Tomcat/4.1.24. Other details, using DB2 Personal Edition version 7.2, on Windows 2000 Professional. I copied C:\sqllib\db2java.zip to $CATALINA_HOME/common/lib directory, renaming to db2java.jar. I verified that the com.ibm.db2.jdbc.app.DB2Driver class was actually in the jar file. In the server.xml listing below I added parms for username and password since I always see them in other postings, although I have always spcified the username/password in the getConnection method call, successfully in websphere. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D server.xml: factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName COM.ibm.db2.jdbc.app.DB2Driver url jdbc:db2:gupt1b password password username user1 maxActive 8 maxIdle 4 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D in web.xml: Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. jdbc/GuppyDB javax.sql.DataSource Container =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D in my servlet: import java.sql.Connection; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; Context initCtx =3D new InitialContext(); Context envCtx =3D (Context) initCtx.lookup("java:comp/env"); DataSource ds =3D (DataSource) envCtx.lookup("jdbc/GuppyDB"); Connection conn =3D ds.getConnection("user1", "passwd"); conn.close(); The following is thrown in the ds.getConnection method: java.sql.SQLException: Cannot load JDBC driver class 'com.ibm.db2.jdbc.app.DB2Driver' Now I did see Fabio Mengue's posting from Feb 20 in a response to someone asking a similar question. I compared his config with mine, added at the top of /bin/setclasspath.sh the line set JAVA_OPTS=3D"-Djava.library.path=3DC:/Program Files/sqllib/java/" and started tomcat with the startup.sh instead of the services start in the Computer Management dialog. The other item: ---------------- Add the following line Create /bin/setenv.sh, as a copy (or a link) of file /sqllib/db2profile. ---------------- I am at a loss, since I cannot find a db2profile file on my PC, although I do have the DB2 server software installed as well as the DB2 client software. If anyone has any helpful suggestions that would be welcome. Thanks Stephen Peterson __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org = --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org