Thread: jdbc2 fails to getDate

jdbc2 fails to getDate

From
pgsql-bugs@postgresql.org
Date:
Palle Girgensohn (girgen@partitur.se) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
jdbc2 fails to getDate

Long Description
Hi.

Here's a java app that has been working well for quite som time on various postgres versions. With 7.1, it fails:

java.lang.NumberFormatException: 12 00:00:00+02
        at java.lang.Integer.parseInt(Integer.java:418)
        at java.lang.Integer.parseInt(Integer.java:458)
        at java.sql.Date.valueOf(Date.java:95)
        at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:427)
...

Here's the select that fails:

SELECT ts_start FROM ent_message WHERE id=176;
        ts_start
------------------------
 2001-04-12 00:00:00+02
(1 row)


I have PGDATESTYLE=ISO

Tha failing code in my app is "... res.getDate(1);"


Sample Code


No file was uploaded with this report