Re: Problems storing timestamps with calendars

From: Kris Jurka <books(at)ejurka(dot)com>
To: Martin Keller <martin(dot)keller(at)unitedplanet(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problems storing timestamps with calendars
Date: 2005-04-29 09:51:51
Message-ID: Pine.BSO.4.56.0504290425001.11511@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 27 Apr 2005, Martin Keller wrote:

> We have some trouble with storing timestamps via
> PreparedStatement.setTimestamp(int, Timestamp, Calendar) into a
> timestamp column without timezone.
> It looks like that the timestamp values are adjusted in the wrong
> direction if the timezone of the calendar is not the default timezone of
> the java vm.
>
> Are we doing anything wrong or is this a bug?
>

Something is definitely wrong here. At first glance it doesn't look
like it's related to the vm timezone, but instead
AbstractJdbc2Statement.changeTime should be respecting Add for the DST
offset, but I'm not quite sure of that. It gets complicated when you've
got to consider four different possible timezones (server, vm, timestamp,
calendar). Does this jar file fix things for you?

http://www.ejurka.com/pgsql/jars/mk/

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-04-29 09:58:34 Re: Impact of open ResultSets and PreparedStatements ?
Previous Message Antony Paul 2005-04-29 09:46:32 Re: Impact of open ResultSets and PreparedStatements ?