Using com.mysql.jdbc.Connection with tomcat dbcp driver connection pool
Posted by: will crick
Date: February 22, 2005 03:13PM

Hi all,

I am trying to implement a web app that uses the com.mysql.jdbc.Connection with a tomcat connection pool using dbcp drivers.

When trying to return the connection object frmo the datasource i can get a java.sql.Connection object, but then cannot cast this into a com.mysql.jdbc.Connection object.

The connection object returned is of type:
org.apache.commons.dbcp.PoolableConnection - which implements the java.mysql.Connection interface - why cant i cast it?? I presume that the mysql Connection object does not implement some methods...

see code:

private javax.sql.DataSource queryDataSource = null;
java.sql.Connection connTemp = queryDataSource.getConnection();

Therefore does anyone have code samples of how to integrate the com.mysql.jdbc.* objects with tomcat connection pools??? Do i need to write my own connection pool?? please say no!!



Options: ReplyQuote

Written By
Using com.mysql.jdbc.Connection with tomcat dbcp driver connection pool
February 22, 2005 03:13PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.