wood burning stoves*
The moose likes JDBC and the fly likes c3p0, Tomcat and ComboPooledDataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "c3p0, Tomcat and ComboPooledDataSource" Watch "c3p0, Tomcat and ComboPooledDataSource" New topic

c3p0, Tomcat and ComboPooledDataSource

William Hardwick

Joined: Dec 03, 2008
Posts: 1
I am trying to create a c3p0 connection pool in Tomcat.

In my context.xml, I have the following:

In my web.xml, I have the following:

And in my class, I am accessing using the following:

I am getting the following exception:

My question is, why is Tomcat casting this to an instance of org.apache.tomcat.dbcp.dbcp.BasicDataSource (why isn't it staying as a ComboPooledDataSource) and what can I do to get it as a PooledDataSource object so that I can call the getNumConnections() method on it?

jQuery in Action, 2nd edition
subject: c3p0, Tomcat and ComboPooledDataSource
Similar Threads
JNDI exception when creating dataSource
JNDI Connection with Oracle (Problem with NullPointerException)
Tomcat Database Connection Pooling Error
DBCP => Cannot create JDBC driver of class '' for connect URL 'null'
problem in getting sybase Datasource in Tomcat 4.1.12