commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: tomcat jndi + commons-dbcp problem
Date Wed, 18 Dec 2002 16:50:44 GMT


On Wed, 18 Dec 2002 pqin@shareowner.com wrote:

> Date: Wed, 18 Dec 2002 11:33:51 -0500
> From: pqin@shareowner.com
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: commons-user@jakarta.apache.org
> Subject: tomcat jndi + commons-dbcp problem
>

These questions are actually appropriate on the TOMCAT-USER list, but what
the heck ...

> Tomcat's JNDI simulation uses commons-dbcp.
>
> I have several questions to ask.
>
> - Can I get an oracle Connection from data source if I use oracle's jdbc
> driver?

Yes.  For Tomcat 4.1, there's example setups for this in the docs shipped
with Tomcat, or online:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

> - "Are all those DBCP classes, such as BasicDataSource, or
> PoolableConnection not castable?" I can't cast BasicDataSource to
> java.sql.DataSource, for example.

There's no such thing as "java.sql.DataSource", but there is
"javax.sql.DataSource" -- and that is the correct interface to cast to.
It works as long as you don't mess around with the class loader hierarchy
by trying to put jdbc2_0-stdext.jar somewhere it doesn't belong.

>
>
> Regards,
>
>
>
> Phillip Qin

Craig McClanahan



Mime
View raw message