Re: Timestamp Conversion Woes Redux

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: Christian Cryder <c(dot)s(dot)cryder(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Timestamp Conversion Woes Redux
Date: 2005-07-20 12:47:47
Message-ID: EFF1E178-E913-40B2-BB66-8A401925011E@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Yes, it does, my mistake ( It was early here )

However reading the notes about setTimestamp:

When the DBMS does not store timezone information the driver will use
cal to construct a JDBC Timestamp value.
If no Calendar object is specified the driver uses the timezone of
the JVM.

Frustratingly it does not say what to do when the DBMS does not store
timezone information. I guess one could infer that
if it doesn't store timezone information, then timezone information
is ignored ?

Which puts us right back to the original problem... Two SQL types,
and only one setTimestamp.

Onel way to deal with this is to find out what the underlying type
is, or to define a different server type, and cast to deal with this
appropriately. IE Oid.javatimestamp and the cast would be able to do
the right thing based on the underlying type.

Dave
On 20-Jul-05, at 8:30 AM, Oliver Jowett wrote:

> Dave Cramer wrote:
>
>
>> In order to calculate the milliseconds the driver takes into
>> account the time zone, information the DBMS may or may not store.
>> If no Calendar object is supplied the driver will use the default
>> Calendar whose time zone is that of the JVM that is
>> running the application. If the DBMS does provide timezone
>> information the driver will simply use that and IGNORE (my caps)
>> a Calendar object that may have been passed to it.
>>
>
> Not having read the source material, but isn't this talking about
> the getTimestamp() path not the setTimestamp() path?
>
> -O
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-07-20 12:53:24 Re: Timestamp Conversion Woes Redux
Previous Message Oliver Jowett 2005-07-20 12:30:23 Re: Timestamp Conversion Woes Redux