in some database , pls describe detail a bean's resultmap in xml file else will cause some problem.
In oracle, date column MUST be TIMESTAMP, the problem cause our site big problem, all user lose time of HH:mm:ss part.
resultmap define in detail is a good way improve performance.


for Jesse Reimann:
   U can write  a column handler for the type .  interface is TypeHandler, then define the  TypeHandler implementation  in resultma p, such as
<result property="gmtLastRepost" column="GMT_LAST_REPOST" jdbcType="TIMESTAMP" javaType="java.util.Date"  typeHandler="your type handler class name"/>
 


Jesse Reimann 写道:

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:[EMAIL PROTECTED]]
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 <[EMAIL PROTECTED]>:

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

 


Reply via email to