dcsimg
How can I retrieve "timestamp with time zone" using jdbc?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alp_Keskin
Posted On:   Thursday, March 31, 2005 12:02 AM

Hi, I wamt to retrieve a field with type "TIMESTAMP WITH TIME ZONE" from oracle database using jdbc. I can use the FetchTSWTZasTimestamp property to allow TIMESTAMP WITH TIME ZONE values to be retrieved as a timestamp however I have no control over the session so I have to retrieve it as STRING using rs.getString("..."); String s = rs.getString("tswtz_field"); when I run this code s becomes "2004-8-8 9.0.0.123457000 US/Eastern"; Is this format the same in every locale? What kind of format is this? how can I convert this string to Date or Calendar type f   More>>


Hi,


I wamt to retrieve a field with type "TIMESTAMP WITH TIME ZONE" from oracle database using jdbc.


I can use the FetchTSWTZasTimestamp property to allow TIMESTAMP WITH TIME ZONE values to be retrieved as a timestamp however I have no control over the session so I have to retrieve it as STRING using rs.getString("...");



String s = rs.getString("tswtz_field");



when I run this code


s becomes "2004-8-8 9.0.0.123457000 US/Eastern";


Is this format the same in every locale? What kind of format is this?



how can I convert this string to Date or Calendar type for any kind of locale?


   <<Less

Re: How can I retrieve "timestamp with time zone" using jdbc?

Posted By:   Alp_Keskin  
Posted On:   Thursday, March 31, 2005 12:15 AM

Hi I am the poster of original question..
I havent solved my problem yet but I want to add something:



when I retrieve the "timestamp with time zone" type as string it comes NLS_TIMESTAMP_TZ_FORMAT ..


I found out NLS_TIMESTAMP_TZ_FORMAT is YYYY-MM_DD HH24:MI:SS.FF TZH:TZM by default.. but my string doesn't look like this..


Can I convert that string to date using SimpleDateFormat? If yes what would be the SimpleDateFormat pattern?


About | Sitemap | Contact