Dear iBATIS Community, I am using iBATIS 2.1.7.597 with Oracle Database 10g Express Edition Release 10.2.0.1.0.
I have got a table which has a column of the data type TIMESTAMP WITH LOCAL TIME ZONE. According to Oracle, one must invoke setSessionTimeZone(java.lang.String regionName) on oracle.jdbc.OracleConnection before accessing any TIMESTAMP WITH LOCAL TIME ZONE data. Please see: http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-ja vadoc/oracle/jdbc/OracleConnection.html#setSessionTimeZone(java.lang.String) I tried to put the sessionTimeZone parameter into the SqlMapConfig file: <transactionManager type="JDBC"> <dataSource type="SIMPLE"> <property name="JDBC.Driver" value="oracle.jdbc.driver.OracleDriver"/> <property name="JDBC.ConnectionURL" value="jdbc:oracle:thin:@//localhost:1521/XE"/> <property name="JDBC.Username" value="username"/> <property name="JDBC.Password" value="password"/> <property name="Driver.sessionTimeZone" value="Berlin/Europe"/> </dataSource> </transactionManager> which did not work. I get following Exception: java.sql.SQLException: Session Time Zone not set! I also tried to use instead of the SimpleDataSource DBCP: <transactionManager type="JDBC"> <dataSource type="DBCP"> <property name="JDBC.Driver" value="oracle.jdbc.driver.OracleDriver"/> <property name="JDBC.ConnectionURL" value="jdbc:oracle:thin:@//localhost:1521/XE"/> <property name="JDBC.Username" value="username"/> <property name="JDBC.Password" value="password"/> <property name="Driver.sessionTimeZone" value="Berlin/Europe"/> </dataSource> </transactionManager> which did not work either. I tested to access TIMESTAMP WITH LOCAL TIME ZONE data in creating a "custom" connection, which worked out nicely: DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@//localhost:1521/XE", "username", "password"); ((OracleConnection)connection).setSessionTimeZone(TimeZone.getDefault().getI D()); SqlMapSession session = sqlMap.openSession(connection); Object o = session.queryForObject("getTimestamp", null); Therefore, I assume that I have to get the OracleConnection somehow from iBATIS (by the SqlMapClient) in order to be able to invoke setSessionTimeZone(java.lang.String regionName). But if call SqlMapClient.getCurrentConnection() I only get a reference to $Proxy0 - how can I get the "real" Connection Object? Any help would be appreciated! Thanks in advance, Florian
