Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

format of the string when rs.getString(

843854Apr 1 2005 — edited Apr 9 2005
I want to retrieve TIMESTAMP WITH TIME ZONE field from Oracle using JDBC..

I have to retrieve it as String (using rs.getString not rs.getDate) so that I can have the Time Zone information, otherwise I lose tz..

String sql = "SELECT field1 , to_char(field1) FROM table";

rs.getString(1) returns string : "2004-8-8 9.0.0.123457000 US/Eastern"

rs.getString(2) returns string formatted according to the property NLS_TIMESTAMP_TZ_FORMAT in Oracle.. in this case i retrieve "08/08/2004 09:00:00 -04:00" when my NLS_TIMESTAMP_TZ_FORMAT is MM/DD/YYYY HH24:MI:SS TZH:TZM


I have no control over the SQL string so I can't use "to_char( ..)" in SQL.. so I have to retrieve the date using rs.getString(1)...

Where is the FORMAT of the string returned by rs.getString(1) defined?
Can it be manipulated? If not is it guranateed that it will always come in this format?

I would appreciate any information regarding the format of the string returned when I retrieve date using rs.getString instead of rs.getDate...


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2005
Added on Apr 1 2005
14 comments
1,241 views