tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Perrone <>
Subject RE: Casting a Connection as an OracleConnection in Tomcat 7
Date Fri, 02 Dec 2011 20:33:22 GMT
I have a customer who is using Oracle Timestamps with TIMEZONE and in order to get any dates
out of this database you have to call an Oracle specific JDBC method to set the TimeZone on
the session.  So, you have to cast the connection to an OracleConnection so you have access
to that set timezone on session method.  It's stupid, because our application handles timezones,
but they've got their policies, ya know. LOL.

Care to elaborate on the "use reflection" suggestion? :)

-----Original Message-----
From: Christopher Schultz [] 
Sent: Friday, December 02, 2011 3:29 PM
To: Tomcat Users List
Subject: Re: Casting a Connection as an OracleConnection in Tomcat 7

Hash: SHA1


On 12/2/11 3:23 PM, Jason Perrone wrote:
> So, I can't cast the connection Tomcat returns as a 
> DelegatingConnection.  DelegatingConnection is from Commons DBCP and 
> this connection is org.apache.tomcat.dbcp.dbcp.PoolableConnection.  I 
> do not want to reference any Tomcat libraries directly because our 
> product is container agnostic.  Any suggestions would be greatly 
> appreciated.

Two thoughts:

1. Use reflection ;)

2. Stop trying to cast to OracleConnection

What do you need OracleConnection for, anyway?

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message