"Jeenicke, Martti" <martti.jeenicke@coremedia.com> wrote:
> The different lines are results of querying the timestamp field
> after different set and setNull operations. Note that the last
> line shows that the timestamp is stored incorrectly even though
> the timestamp and timezone does not change in the test.
Confirmed. Your program gave me this:
Feb 8, 2010 6:49:21 PM
Feb 8, 2010 6:49:21 PM
Feb 8, 2010 6:49:21 PM
Feb 8, 2010 12:49:21 PM
and psql shows this afterward:
mydatabase=# select * from mje.tab1 ;
id | testdate
----+-------------------------
1 | 2010-02-08 18:49:21.784
2 |
3 | 2010-02-08 18:49:21.784
4 | 2010-02-08 18:49:21.784
5 |
6 | 2010-02-08 12:49:21.784
(6 rows)
The first three are correct for current GMT. The last is local time
here. I tried closing out the result set properly by adding these
line to the end of the selectValue method, with no change in
results.
resultSet.next();
resultSet.close();
I was also confused by the result of changing the column to
TIMESTAMP WITH TIME ZONE -- all timestamps were the same, but they
were two hours later than local time and four hours earlier than
GMT!?!
This was on kubuntu with Java 1.6.0_17.
-Kevin