tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Gregg" <john.gr...@techarch.com>
Subject RE: driver manager does not work neither giving error
Date Wed, 12 Jun 2002 16:06:58 GMT
I don't think Tomcat will recognize classes12.zip no matter where you put
it.  Rename it to classes12.jar and place it under
<tomcat-home>webapps/<project>/web-inf/lib, <tomcat-home>/lib, or
<tomcat-home>/common/lib.  If Tomcat can't find the driver class, I'd expect
a ClassNotFoundException in your localhost_log file.  Look in
<tomcat-home>/logs.  Try using a debugger or putting a try/catch around your
code.

Also, if you're happy with hard-coding which db driver to use in your
application, don't bother with Class.forName(...).  It's purpose is to allow
your application to be unaware of the particular driver.  In that case you'd
do this:

String driverName = System.getProperty("driverName");
Class clazz = Class.forName(driverName);
DriverManager.registerDriver(clazz.newInstance());

Of course you'd give up the ability to use driver-specific extensions but
you could swap drivers and databases more easily.

john

-----Original Message-----
From:
tomcat-user-return-22260-john.gregg=techarch.com@jakarta.apache.org
[mailto:tomcat-user-return-22260-john.gregg=techarch.com@jakarta.apache.
org]On Behalf Of Vikramjit Singh
Sent: Wednesday, June 12, 2002 2:39 AM
To: 'tomcat-user@jakarta.apache.org'; JSP-INTEREST (E-mail)
Subject: driver manager does not work neither giving error


Hi,

I am deploying my application from tomcat 3.2.1 to tomcat 4.0.3. I have
installed tomcat 4.0.3 and its working fine. I have a servlet which is
loaded on start up. The servlet is for connection pooling which opens the
connections. I am using oracle driver classes12.zip for connection pooling.

In my OracleConnectionPool.java these lines are not being reached:

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");

and after these  lines the connection pooling methods of Oracle driver is
called.

neither is it throwing any error.

Since before these lines which ever code is there its working as the
system.out.println statements are being printed on the console. I know
Tomcat 4.0.3 has in built ConnectionPooling mechanism, hope thats not the
source of the problem. I am pretty much confused. Atleast it should throw an
error.

Thanking in advance.

Regards,
Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-1031


--
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