JDBC Connection and ClassNotFoundException

From: Julie (julie_preece_at_nfumutual.co.uk)
Date: 12/22/04


Date: 22 Dec 2004 00:26:33 -0800

I have installed Websphere Studio Application Developer v5.1.2 and DB2
version 8.1.3 on my machine. I have a written a java class that tries
to connect to a local DB2 database, I have used :
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"), and I get a
ClassNotFoundException. From browsing various groups this seems to be
a common problem.
I have checked my classpath (using Window -> Preferences -> Java ->
Classpath variables), and the DB2_DRIVER_PATH is set to g:\program
files\ibm\sqllib\java\db2java.zip. I have checked and the zip file is
in this directory.
As a test, I have also created a connection in the Data Perspective
and am able to successfully connect to my local database and this uses
the same JDBC driver class as I'm trying to use in my class ! This
seems to indicate I've installed everything I need.
Does anyone know what I'm doing wrong ? How can I get my java class to
access the jdbc driver class ?