You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "MANOHARAN,MADHAN (HP-PaloAlto,ex1)" <ma...@hp.com> on 2002/12/13 19:16:51 UTC

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(com.microsoft.jdbcx.sqlserver.SQLServerDataSource) for the
driverclassname.
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
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:529)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
        at foo.DBTest.init(DBTest.java:32)
        at org.apache.jsp.test_jsp._jspService(test_jsp.java:50)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)