On Wed, 18 Dec 2002 pqin@shareowner.com wrote:
> Date: Wed, 18 Dec 2002 12:24:47 -0500
> From: pqin@shareowner.com
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: commons-user@jakarta.apache.org
> Subject: RE: tomcat jndi + commons-dbcp problem - to Craig
>
> Thanks Craig.
>
> - I did setup according to the one you mentioned in your posting, web.xml,
> server.xml.
> - I never got any answer from tomcat user list. Since my issue deals with
> commons-dbcp, I posted here instead.
> - A typo in my posting, it should be javax.sql.DataSource.
> - I placed jdbc2_0-stdext.jar in my application's WEB-INF/lib folder and
> classes12.jar in $CATALINA_HOME/common/lib
The first part of this is a mistake. The jdbc2_0-stdext.jar file is
already there in common/lib, and should *not* be installed in your webapp.
> - The connection returned is org.apache.commons.dbcp.PoolableConnection
> neither OraclePoolableConnection nor OracleConnection
>
> Question, is org.apache.commons.dbcp.BasicDataSource smart enough to return
> an driver-specific connection, in this case, OraclePoolableConnection or
> OracleConnection?
>
You should be casting the returned connection object to
java.sql.Connection, and not trying to worry about it's internal Oracle
implementation class name. The object returned by commons-dbcp is a
wrapper around whatever Connection implementation your JDBC driver
returns.
Craig