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

Started by Kim Hoabout 23 years ago1 messagespatches
Jump to latest
#1Kim Ho
kho@redhat.com

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

Attachments:

fixsetobjectswithtimes.difftext/x-patch; charset=UTF-8; name=fixsetobjectswithtimes.diffDownload+7-0