Re: JDBC problem with dates and ANYELEMENT type

From: "Peter" <peter(at)greatnowhere(dot)com>
To: "'Kris Jurka'" <books(at)ejurka(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC problem with dates and ANYELEMENT type
Date: 2009-04-24 08:44:30
Message-ID: 01e001c9c4b8$e28c93a0$a7a5bae0$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>> Any suggestions how to work around this so we can still use ANYELEMENT
>> and pass in DATE?

> You can put a cast into the query itself "SELECT ?::date".

Nah... that's no good. The same query string is used for many different types in my app - such approach would require me to parse the SQL string and append cast to date when argument is java.sql.Date. I'll leave this as last-ditch approach.

What are the potential implications if I patch setDate() method in AbstractJdbc2Statement to pass OID.Date instead of 'unspecified'? Would that break anything else? We don’t use timestamps anywhere in the app yet, so I'm not really worried about timezone being potentially screwed up.

Peter

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Lister 2009-04-24 09:05:23 Re: JDBC problem with dates and ANYELEMENT type
Previous Message Jeppe Sommer 2009-04-24 08:19:34 Re: Here's a fix to AbstractJdbc3Statement.getGeneratedKeys