tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Wickson" <a...@awtech.co.uk>
Subject Re: Loading jdbc driver
Date Thu, 24 Oct 2002 09:33:12 GMT
Thanks for the idea Sean.  I tried putting the jar file under my WEB-INF\lib
directory but get the same error.
If I then try to delete this file with TC running I can't because TC has
locked it, so this would indicate that TC thinks it found something it
likes!

Regards
Andy Wickson

----- Original Message -----
From: "Sean Reilly" <sreilly@point2.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Wednesday, October 23, 2002 10:11 PM
Subject: RE: Loading jdbc driver


by the all caps in CLASSPATH, I assume that you mean the CLASSPATH
environment variable.
Try putting the classes/jar in the WEB-INF/lib directory of the webapp
instead.

Sean Reilly
Programmer, Point2 Technologies, Inc.
(306) 955-1855
sreilly@point2.com <mailto:sreilly@point2.com>


-----Original Message-----
From: Andy Wickson [mailto:andy@awtech.co.uk]
Sent: Wednesday, October 23, 2002 9:21 AM
To: Tomcat Users List
Subject: Loading jdbc driver


Hi,

I am attempting to access a Cloudscape DB.
The driver is com.ibm.db2j.jdbc.DB2jDriver and this class is present in the
relevant jar file which is in CLASSPATH.

My web.xml file contains the following:
    <init-param>
      <param-name>driver</param-name>
      <param-value>com.ibm.db2j.jdbc.DB2jDriver</param-value>
    </init-param>

and my servlet attempts to load it thus:

String driver = getServletConfig().getInitParameter("driver");

    if (driver == null) {
      throw new UnavailableException("Driver not specified.");
    }

    try {
      Class.forName(driver);
    } catch (ClassNotFoundException cnfe) {
      throw new UnavailableException("Driver <" + driver
                                     + "> not found in the classpath.");
    }

The ClassNotFoundException is thrown when the servlet is called.

Any ideas?

Regards
Andy Wickson

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message