Fix setObject() with java.sql.Types.Date/Time/Timestamp - Mailing list pgsql-jdbc

From Kim Ho
Subject Fix setObject() with java.sql.Types.Date/Time/Timestamp
Date
Msg-id 1056055946.19807.131.camel@topanga.toronto.redhat.com
Whole thread Raw
List pgsql-jdbc
Problem:
 - Error if user attempts to call:
1. setObject(x,y,java.sql.types.Timestamp) if y is a Date
2. setObject(x,y,java.sql.types.Time) if y is a Timestamp
3. setObject(x,y,java.sql.types.Date) if y is a Timestamp
4. setObject(x,y,java.sql.types.Date/Timestamp/Time) if y is a string
with valid date/timestamp/time format

1 - 3 are causing failures in the JDBC CTS.

Fix:
1. adds 00:00:00.0 as time portion of timestamp
2. substring() to remove date
3. substring() to remove time
4. check for instance of java.sql.types.date/time/timestamp and use
valueOf if necessary


Cheers,

Kim

Attachment

pgsql-jdbc by date:

Previous
From: Kim Ho
Date:
Subject: Allow setObject(x,y,Types.INTEGER) if y is Boolean & added Boolean to SQL Keywords
Next
From: Kim Ho
Date:
Subject: Add checking in setMaxRows, setQueryTimeout, and setFetchSize