Home » Infrastructure » Unix » Oracle timestamp insert problem (Oracle 11G client, HP-UX 11.31)
Oracle timestamp insert problem [message #473845] Wed, 01 September 2010 02:27 Go to next message
lalit.thawani
Messages: 11
Registered: April 2007
Junior Member
Hi !

I am working on to upgrade the oracle client from 10G to 11G on the HP-UX 11.31.
The problem that i am facing is related to timestamp. The timestamp values that gets logged in using 10G client is in GMT.( I use the java flag -Doracle.jdbc.V8Compatible=true to make it happen).

Since i upgraded to 11G client all the timestamp logging is in local time, which is a problem.
Is there a way i could continue timestamp logging in GMT?

Thanks
Lalit
Re: Oracle timestamp insert problem [message #475220 is a reply to message #473845] Mon, 13 September 2010 14:34 Go to previous messageGo to next message
lalit.thawani
Messages: 11
Registered: April 2007
Junior Member
Ok ! Got the resolution.
It looks like the behavior of PreparedStatement.setTimeStamp () api is changed with the 11G client.

Until 10G this api call works fine
dbPreparedStatement.setTimestamp(memberIndex++, dbTimeStamp);

and it sets the timestamp in the zone in which the dbTimeStamp is defined. (can be GMT/PST etc).

Now with 11G this call does not work at it is. It needs an extra calendar object as a parameter to work.

Calendar gmtCal = Calendar.getInstance();
dbPreparedStatement.setTimestamp(memberIndex++, dbTimeStamp, gmtCal);


This code change resolves the issue for me.

Thanks
Lalit
Re: Oracle timestamp insert problem [message #475222 is a reply to message #475220] Mon, 13 September 2010 14:55 Go to previous message
Michel Cadot
Messages: 68617
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

Regards
Michel
Previous Topic: listing files in solaris with inode number
Next Topic: Swap Space Error -> installation 10g R2 on Solaris 10
Goto Forum:
  


Current Time: Tue Mar 19 03:02:49 CDT 2024