Thread: Fix setObject() with java.sql.Types.Date/Time/Timestamp

Fix setObject() with java.sql.Types.Date/Time/Timestamp

From
Kim Ho
Date:
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