Fix setObject() with Time/Timestamp/Date + Timezones

From: Kim Ho <kho(at)redhat(dot)com>
To: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Cc: Dave Cramer <Dave(at)micro-automation(dot)net>, Barry Lind <blind(at)xythos(dot)com>
Subject: Fix setObject() with Time/Timestamp/Date + Timezones
Date: 2003-07-07 13:23:31
Message-ID: 1057584211.21368.20.camel@topanga.toronto.redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Problem:
- Doesn't accept any object of java.util.Date
- Doesn't handle strings
- Doesn't deal with timezones (when used with strings)

Fix:
- Grab timezones from strings (if any) and change to java.util.Date
- Use getTime() to get milliseconds value to get correct
Date/Time/Timestamp

The setObjects where java.util.Dates are passed in are very
straightforward.

The ones with the Strings passed in take a bit of work. I attempted to
follow the guidelines of the toDate/Time/Timestamp in ResultSet and
incorporated timezones into them.

Attached is the patch, please have a look.

Comments/suggestions always welcome.

Cheers,

Kim

Attachment Content-Type Size
fixsetobjectswithtimes.diff text/plain 7.1 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Felipe Schnack 2003-07-07 20:37:22 maybe a serialization error?
Previous Message Sonjoy Datta 2003-07-07 13:01:27 Information needed