commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Mangano" <>
Subject RE: Connection pool nightmare!
Date Fri, 13 Dec 2002 18:58:15 GMT
By the looks of it you don't have the driver class specified properly in your server.xml. To
debug this problem:

1. Check that your jdbc driver is in the <TomcatHome>/common/lib directory

2. Write a quick test class to check the driver name, driver url, username and password you
are using. Something very simple like:
Driver jsqlDriver = (Driver) Class.forName(jsqlDriverName).newInstance();
Connection conn = DriverManager.getConnection(driverUrl, userName, password);

3. If this works open your server.xml in <TomcatHome>/conf and compare it to the example
just switching the driver name, driver url, username and password with your own.

4. Open your web.xml and also check it against the example above to see if everything is properly

-----Original Message-----
From: MANOHARAN,MADHAN (HP-PaloAlto,ex1)
Sent: December 13, 2002 1:17 PM
To: 'Jakarta Commons Users List'
Subject: Connection pool nightmare!

Hi guys,
  I bet there were many postings on this issue before.  I searched the
archive, but couldn't figure out a way to solve this and so posting again.
I use SQL Server 2000, JDBC drivers from MS for SQL Server 2000, Tomcat
4.1.6, windows XP.  I was trying to implement connection pooling and this is
what I did

1) created a connection pool from tomcat admin(pointing to
http://localhost:8080/admin) ).  I did use the datasource driver from
MS( for the
2) created a web.xml with the Resource reference entry
3) created a simple java class where I lookup the context via jndi and try
to get a connection.
4) created a jsp to call the java class.

When I hit the jsp, it calls the java class.  The java class looks up the
datasource and finds it( I guess), but when I try to get the connection, I
get this error

java.sql.SQLException: Cannot load JDBC driver class 'null'
        at foo.DBTest.init(
        at org.apache.jsp.test_jsp._jspService(
        at javax.servlet.http.HttpServlet.service(

View raw message