ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Reimann" <jreim...@ctigroup.com>
Subject RE: Retrieving Oracle column with data type TIMESTAMP WITH LOCAL TIME ZONE
Date Tue, 18 Mar 2008 15:39:08 GMT
Thanks for the suggestion, but that didn't help since it is the actual
oracle jdbc driver that is throwing the exception and just setting the
session within oracle doesn't stop prevent this.

 

I think I'm just going to abandon this approach and attack the problem
from a different angle and handle all my time zone conversion stuff
explicitly within Oracle. Thinking about it more setting a connection
level local time zone won't solve the business need since we need to
allow the time zone to be changed on the individual SQL statement
execution basis.

 

 

Jesse

 

________________________________

From: Andrey Rogov [mailto:andrey.rogov@gmail.com] 
Sent: Monday, March 17, 2008 9:43 PM
To: user-java@ibatis.apache.org
Subject: Re: Retrieving Oracle column with data type TIMESTAMP WITH
LOCAL TIME ZONE

 

Jess, 
   try to execute sql operator ALTER SESSION before accessing TIMESTAMP
WITH LOCAL TIME ZONE data 
   
   <update id="setTimeZone" parameterClass="java.lang.String"> 
        ALTER SESSION SET time_zone = #timezonevalue#  
   </update>
  
     
    
   

2008/3/17, Jesse Reimann <jreimann@ctigroup.com>:

I'm trying to retrieve an Oracle column that is defined as TIMESTAMP
WITH LOCAL TIME ZONE. Currently I'm receiving an error stating  

 

--- Cause: java.sql.SQLException: Session Time Zone not set!

 

Looking into it I need to specify the Session Time Zone as part of the
Oracle JDBC Connection properties.

 

I found this in an Oracle document when searching for a solution:

 

Before accessing TIMESTAMP WITH LOCAL TIME ZONE data, call the
OracleConnection.setSessionTimeZone(String regionName) method to set the
session time zone. When this method is called, the JDBC driver sets the
session time zone of the connection and saves the session time zone so
that any TIMESTAMP WITH LOCAL TIME ZONE data accessed through JDBC can
be adjusted using the session time zone.

 

 

So my question is how would I go about calling the setSessionTimeZone
method of the OracleConnection when using iBATIS (and Spring).

 

Thanks,

 

Jesse Reimann

 


Mime
View raw message