RE: JDBC and Timestamps

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Chris Ryan'" <chris(at)greatbridge(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: JDBC and Timestamps
Date: 2000-08-05 13:20:00
Message-ID: 1B3D5E532D18D311861A00600865478CF1B1E4@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

This should already be fixed in cvs.

Peter

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

-----Original Message-----
From: Chris Ryan [mailto:chris(at)greatbridge(dot)com]
Sent: Saturday, August 05, 2000 1:26 PM
To: pgsql-interfaces(at)postgresql(dot)org
Subject: [INTERFACES] JDBC and Timestamps

I'm working on a project where I update/insert/select records through
JDBC and I'm noticing problems with the timestamp fields. The JDBC
driver when writing a Timestamp value to postgres is passing the value
to the backend as a String in the following format "yyyy-mm-dd
hh:mm:ss.fffffffff" <-- the last part .fffffffff is nanosecs. When
Postgres reads this is things it is millisecs so converts it and appends
the timezone. Now when the JDBC driver reads the value back in it is
trying to do a date conversion from a string using the format
"yyyy-mm-dd hh:mm:sszzz" which has timezone but no millisecs. The
different formats of course cause exceptions to be generated. I tried
using the setLenient(true) but this didn't make any difference.

Chris Ryan

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-05 23:30:10 Re: JDBC and Timestamps
Previous Message Chris Ryan 2000-08-05 12:26:29 JDBC and Timestamps