It's not a secret anymore!
The moose likes Tomcat and the fly likes Tomcat Connection Pooling Help required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Connection Pooling Help required" Watch "Tomcat Connection Pooling Help required" New topic

Tomcat Connection Pooling Help required

nitin kumar

Joined: Feb 11, 2004
Posts: 6
Hi all,
This may be repeated question, but I could not find any satisfying solution to my problem in previous solutions.

i m working on developing a web application and want to implement database pooling.

Server:: Tomcat 5.0
DB:: mysql 4.0

I deploy and undeploy my application using tomcat manager,
hence i donot have the <Context> element configured in the server.xml
For database pooling, I used the element <GlobalNamingResources>

After these settings, the Tomcat Admin shows the Data Source Created with name jdbc/MyappDB

When I run the application and hit the url where the database connection is obtained, I get the following error::

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

Can somebody help me on this ?
Basically the question here is that, if the <Context> element is not used, what web.xml setting have to be made to access this Data source in Global area.

Note: the <Context> element have the element <ResourceLink> to access such global resources.

Following is my settings.
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase"/>
<ResourceParams name="UserDatabase">
<Resource name="jdbc/MyappDB" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/MyappDB">
web.xml settings..
<description>DB Connection</description>
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32609

This sounds like a classpath or Tomcat configuration issue. I'm going to move this to our Tomcat forum so you can get more help.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

is your mysql driver jar file in the common/lib directory?
Nina Savannah
Ranch Hand

Joined: Oct 15, 2008
Posts: 35
Hi Nitin Kumar, did you manage to find a solution for this problem?

I have the same specification and I am trying to do connection pooling, can you help?
Bhaskar Rao

Joined: Apr 25, 2005
Posts: 23

I have had this issue earlier. This is a generic error and can be thrown for various reasons. Have you tried defining the context as either 'context.xml' or yourwebappname.xml ?

have a look at the following URLTomcat config
[ December 28, 2008: Message edited by: Bhaskar Rao ]
I agree. Here's the link:
subject: Tomcat Connection Pooling Help required
It's not a secret anymore!