From: | "Tom Hargrave" <Tomh(at)fisher(dot)co(dot)uk> |
---|---|
To: | undisclosed-recipients: ; |
Subject: | JDBC with PostgreSQL 7.2 |
Date: | 2002-03-26 14:23:11 |
Message-ID: | sca0845c.001@mailhost.fisher.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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);
**************************************************************************************************
CONFIDENTIAL AND PRIVILEGED INFORMATION
IMPORTANT: This message is intended for the addressee only and is privileged and
confidential. If you are not the addressee, then please DO NOT read, copy or
distribute it, but reply to the sender that you received it in error and delete it. Thank
you.
Fisher Scientific U.K., Limited.
Registered Office:
Bishop Meadow Road,
Loughborough LE11 5RG
England
Registered in England No: 2883961
From | Date | Subject | |
---|---|---|---|
Next Message | Art Taylor | 2002-03-26 17:54:20 | Customized Type Mapping |
Previous Message | Dave Cramer | 2002-03-26 12:11:25 | Re: server shutting down |