Timestamp issue from ojdbc5 & ojdbc6

From: pravdas <pdas77(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Timestamp issue from ojdbc5 & ojdbc6
Date: 2013-12-05 07:33:46
Message-ID: 1386228826869-5781795.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

JVM Timezone details :India Standard TimeAsia/Calcutta019800000
DB Timezone details :Central Standard TimeAmerica/Chicago3600000-21600000

String sql = "select systimestamp as base from dual";
.....
PreparedStatement stmt = con.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while(rs.next()) {
System.out.println(rs.getTimestamp("base"));
System.out.println(rs.getString("base"));
}

Test-1:
I tested using ojdbc14.jar 10.1.0.3.0 with, it works as expected printing
the db time

Output:
2013-12-05 01:23:57.141583
2013-12-5 1.23.57.141583000 -6:0

Test-2:
I tested using ojdbc5.jar & ojdbc6.jar 11.2.0.3.0 with, getTimestamp print
local time where as getString prints db time.

Output:
2013-12-05 12:57:54.3508
2013-12-05 01:27:54.3508 -6:00

Please suggest what is wrong with Test-2 ojdbc driver version 11.2.0.3.0
where the getTimestamp() prints local time. My application expect the db
time like Test-1 in the getTimestamp().

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Timestamp-issue-from-ojdbc5-ojdbc6-tp5781795.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-12-05 16:56:22 Re: Timestamp issue from ojdbc5 & ojdbc6
Previous Message Andrew Gaul 2013-12-04 21:14:56 Re: JDBC lint