If compile fail - you need a nightly of dbcp. If run-time fail, you may need to use getInnermostDelegate() instead
-Tim
Chakravarthy, Sundar wrote:
I tried the following with no success,
1. PoolableConnection pc = (PoolableConnection)conn; 2. OracleConnection oc = (OracleConnection)pc.getDelegate();
Fails in line 2
-Sundar
-----Original Message-----
From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 10:34 AM
To: Tomcat Users List
Subject: Re: Casting DBCP Connection to OracleConnection
All dbcp objects have a getDelegate() method (I think). But you'll need to do 2 casts.
- dbcpConn = (DBCPClassCast)conn--> The dbcp connection
- myOraConn = (OraClassCast)dbcpConn.getDelegate() --> Get the underlying implementation
Look at the DBCP javadocs for the correct class names.
BUT you'll need to use a nightly build of dbcp to do this since the version shipped with tomcat doesn't have the getDeletgate() methods.
-Tim
Marco Rossi wrote:
I have the same problem. If you find a solution, please reply
HI,
I am using Tomcat 4.1.18 with Oracle 9i. When I try to cast the Connection returned from DBCP to OracleConnection I get a ClassCastException .
Anyone here know how to cast correctly ?
Thanks
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]