toTimestamp fractional seconds fix (patch against CVS)

From: Florian Wunderlich <fwunderlich(at)devbrain(dot)de>
To: PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
Subject: toTimestamp fractional seconds fix (patch against CVS)
Date: 2002-12-23 13:05:08
Message-ID: 3E070A04.BB0EC23C@hq.factor3.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

In the CVS, in AbstractJdbc1ResultSet.java, a Timestamp returned from
toTimestamp is created with DateFormat.parse, which means that
fractional milliseconds are dropped - no more than 3 fractional digits
are considered.

1. This means that the JDBC driver returns values that are not in the
database. A subsequent query specifying this value in a WHERE clause for
example will not return the record in question.

2. java.sql.Timestamp specifies that all fractional seconds are to be
stored in the nanos field, and that the getTime method shall return only
integral seconds.

The attached patch against the most recent version from the CVS as of
2002-12-23 14:02 (rev 1.7) fixes this behavior. I have verified it
against postgresql-7.2.1.

Attachment Content-Type Size
timestamp.patch text/plain 4.9 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Remigius Stalder 2002-12-23 16:50:12 Re: Stored procedures/functions that can return recordsets...
Previous Message Daniel Serodio 2002-12-23 11:24:02 Re: JDBC Error