Skip site navigation (1) Skip section navigation (2)

JDBC and Timestamps

From: Chris Ryan <chris(at)greatbridge(dot)com>
To: "pgsql-interfaces(at)postgresql(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: JDBC and Timestamps
Date: 2000-08-05 12:26:29
Message-ID: 398C07F5.FE194B49@greatbridge.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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

pgsql-interfaces by date

Next:From: Peter MountDate: 2000-08-05 13:20:00
Subject: RE: JDBC and Timestamps
Previous:From: Michael MeskesDate: 2000-08-04 23:26:32
Subject: Re: Embedded SQL C++ preprocessor ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group