You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Kwan Michael <go...@yahoo.com> on 2004/06/18 21:30:52 UTC

[dbcp] cast connection from datasource to OracleConnection failed. connection.getDelegate() returns a oracle.jdbc.driver.T4CConnection

I m using Tomcat 4.1.27, oracle 9i.

I have database pooling setup using dbcp (1.0 i
believe comes with tomcat 4.1.27)

so after i retrieve my datasource
and i did the following

Connection conn = ds.getConnection();
System.out.println(conn.getDelegate().getClass.getName());

I read everywhere that it is suppose to be
OracleConnection, but it returns 
oracle.jdbc.driver.T4CConnection (not even in oracle
javadoc)

Anybody knows why?
I want to use OracleConnection because they provide
statement caching which is not provided in dbcp 1.0.

I also did consider an upgrade to dbcp 1.1, 1.2 but
the performance is not as good as the documents
indicated (i see some performance down turn using
basically the same settings).

MK


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [dbcp] cast connection from datasource to OracleConnection failed. connection.getDelegate() returns a oracle.jdbc.driver.T4CConnection

Posted by Rodney Waldhoff <rw...@apache.org>.
On Fri, 18 Jun 2004, Kwan Michael wrote:

> I m using Tomcat 4.1.27, oracle 9i.
>
> I have database pooling setup using dbcp (1.0 i
> believe comes with tomcat 4.1.27)
>
> so after i retrieve my datasource
> and i did the following
>
> Connection conn = ds.getConnection();
> System.out.println(conn.getDelegate().getClass.getName());
>
> I read everywhere that it is suppose to be
> OracleConnection, but it returns
> oracle.jdbc.driver.T4CConnection (not even in oracle
> javadoc)
>
> Anybody knows why?

getDelegate simply returns whatever your underlying connection is.  This 
will be a function of the underlying DataSource or connect string you're 
using.

> I want to use OracleConnection because they provide
> statement caching which is not provided in dbcp 1.0.

DBCP 1.0 does in fact support PreparedStatement pooling by the way, 
although the Tomcat configuration doesn't expose a way to turn it on.  If 
you use DBCP 1.0 directly (configured via JOCL or directly through Java) 
you can enable prepared statement pooling.  It's only the DataSource 
configuration that doesn't expose it.
>
> I also did consider an upgrade to dbcp 1.1, 1.2 but
> the performance is not as good as the documents
> indicated (i see some performance down turn using
> basically the same settings).

That's curious.  I wonder if anyone knows why that is.

>
> MK
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org