Re: JDBC with PostgreSQL 7.2

From: Thomas O'Dowd <tom(at)nooper(dot)com>
To: Tom Hargrave <Tomh(at)fisher(dot)co(dot)uk>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC with PostgreSQL 7.2
Date: 2002-04-02 23:18:14
Message-ID: 20020403081814.G9908@beast.uwillsee.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Tom,

Are you using the latest driver? A patch went in after 7.2 was released
to fix a problem that caused a out of range exception. Pre 7.2 drivers
will also not work with a 7.2 database as the timestamp format is more
accurate in 7.2.

If you are using the latest driver, can you send me the stacktrace of
the exception and if you can the particular timestamp that is causing
it.

By latest driver I mean either built from cvs or the one at
http://jdbc.postgresql.org/download.html under the development
driver section.

Cheers,

Tom.

On Tue, Mar 26, 2002 at 02:23:11PM +0000, Tom Hargrave wrote:
> Hi, hope this is the right email address.
>
> We are in the process of upgrading and have encountered problems with TimeStamps with JDBC.
>
> When trying to insert a record and then retrieve it we get a "String index out of range" exception thrown. It looks as though the "nano" section is causing the problem, if I edit the record and remove it, the record can then be retrieved.
>
> Any ideas/patches would be much appreciated. I enclose the code that worked on previous releases.
>
> Thanks, Tom
>
> Insert/Update Code (works but seems to truncate nano)
> ==================================
> _preparedstmt.setTimestamp(1, new java.sql.Timestamp(new Date().getTime()));
>
> Retrieve Code (Only works after nano removed)
> =============================
> java.util.Date _tmpdate = (java.util.Date) _resultset.getTimestamp(2);
--
Thomas O'Dowd. - Nooping - http://nooper.com
tom(at)nooper(dot)com - Testing - http://nooper.co.jp/labs

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-04-03 05:18:28 Re: Fwd: org/postgresql/jdbc2/ResultSet.java
Previous Message Bruce Momjian 2002-04-02 19:40:33 Re: Fwd: org/postgresql/jdbc2/ResultSet.java