Re: [INTERFACES] JDBC, Timestamps, and DateStyle - Mailing list pgsql-interfaces

From Peter T Mount
Subject Re: [INTERFACES] JDBC, Timestamps, and DateStyle
Date
Msg-id Pine.LNX.3.96.981027105346.4458F-100000@taer.maidstone.gov.uk
Whole thread Raw
In response to JDBC, Timestamps, and DateStyle  (Aleksey Demakov <avd@gcom.ru>)
List pgsql-interfaces
On 27 Oct 1998, Aleksey Demakov wrote:

>
> I had problems reading datetime fields with the ResultSet.getTimestamp
> method. First, it looks like this method always assumes that DateStyle
> is ISO. At the same time the driver checks current DateStyle in the case
> of Dates and acts accordingly. IMHO, it's a bit incosistent.
>
> As I recall the ODBC driver has no such problems because it always uses
> the same format for communication with backend. It sets it when it opens
> a connection.

I had thought of doing the same, but ran out of time (other things forced
me away for a while)...

> But it is not my main problem since I can set DateStyle by myself.
>
> The other problem is that the driver simetimes fails to parse timestamps.
> I found two reasons for this. The first is that the timestamp can contain
> fractions of second. The second relates to timezones. I don't quite
> understand it, though. I simply rewrote the code so it works for me. And
> I believe it should also work for others.
>
> The patch is below.

I'll take a look at it when I get home.

[patch snipped]

Peter


pgsql-interfaces by date:

Previous
From: Aleksey Demakov
Date:
Subject: JDBC, Timestamps, and DateStyle
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [INTERFACES] JDBC, Timestamps, and DateStyle