Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

db connection pooling to mssql from Tomcat 4.0.6

Razvan Droscaru
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I know this was a very debated problem and often resolved. Db connection pooling to MSSQL Server from Tomcat 4.0.6. The error is:

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver

I have put the commons-collections-3.0.jar, commons-dbcp-1.1.jar, commons-pool-1.1.jar, jtds-0.8-rc1.jar files in %TOMCAT_HOME%\common\lib\
My configuration files looks like:

1. %TOMCAT_HOME%\conf\server.xml

<context path="/testWEB" docBase="testWEB.war" debug="1" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="testWEB_log."
suffix=".txt" timestamp="true"/>
<Resource name="jdbc/mspool" auth="Container" type="javax.sql.DataSource" />
<ResourceParams name="jdbc/mspool">

2. %TOMCAT_HOME%\webapps\testWEB.war\WEB-INF\web.xml:

<description>MSSQL Test App</description>

3. and

Context initCtx = new InitialContext();
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/mspool");
if (ds != null)
dbConnection = ds.getConnection();

If you have a solution, please give some feedback.

Thank you

Razvan Droscaru
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic