Bingo. Yep, screw casting as an Oracle connection. Just do this:
session.beginTransaction(); PreparedStatement st = session.connection().prepareStatement("alter session set TIME_ZONE='" + timeZone.getID() + "'"); st.execute(); session.connection().commit(); st.close(); Thanks Christopher, for getting me to think outside the box :) -----Original Message----- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, December 02, 2011 3:29 PM To: Tomcat Users List Subject: Re: Casting a Connection as an OracleConnection in Tomcat 7 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason, 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7ZNSgACgkQ9CaO5/Lv0PA8iACeIyzpkgEx7B49HKcx7ZquASYK UXEAnRAL4dcEPFENnatgp0WSJ+rQXMAN =AWRl -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org