Re: Problem with 8.1 driver

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with 8.1 driver
Date: 2005-12-09 09:41:41
Message-ID: 43995155.5000301@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote:
> On Tue, 6 Dec 2005, Michael Paesold wrote:
>
>> Another question that occurred to me is, how should I tell the driver
>> to specify a type as "undefined" or "unknown" to the server?
>>
>> Some random tries that did not work:
>> stmt.setObject(2, "1 month", java.sql.Types.OTHER);
>> --> Cannot cast an instance of String to type Types.OTHER
>
> You can use
>
> stmt.setObject(2, new org.postgresql.util.PGInterval("1 month"));

Thanks, that works. Altough I would prefer a way to do this in a
standard way (without org.postgresql classes). The real problem here is
probably that there is no Types.INTERVAL. What a shame.

Do you think it would be reasonable for the driver to implementing
> stmt.setObject(2, "1 month", java.sql.Types.OTHER);
as sending the parameter as "unknown"?
I.e. would a patch implementing this be accepted? Or is Types.OTHER
reserved for a different meaning?

Best Regards,
Michael Paesold

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Paesold 2005-12-09 09:43:52 Re: Problem with 8.1 driver
Previous Message Roshan Nair 2005-12-09 06:59:45 Passing an array or record to a stored procedure through jdbc