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

From: Kim Ho <kho(at)redhat(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Fix setObject() with java.sql.Types.Date/Time/Timestamp
Date: 2003-06-19 20:52:26
Message-ID: 1056055946.19807.131.camel@topanga.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

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 Content-Type Size
fixsetobjectswithtimes.diff text/x-patch 1.7 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kim Ho 2003-06-19 20:52:47 Add checking in setMaxRows, setQueryTimeout, and setFetchSize
Previous Message Kim Ho 2003-06-19 20:51:53 Allow setObject(x,y,Types.INTEGER) if y is Boolean & added Boolean to SQL Keywords

Browse pgsql-patches by date

  From Date Subject
Next Message Kim Ho 2003-06-19 20:52:47 Add checking in setMaxRows, setQueryTimeout, and setFetchSize
Previous Message Kim Ho 2003-06-19 20:51:53 Allow setObject(x,y,Types.INTEGER) if y is Boolean & added Boolean to SQL Keywords