Re: Problem with 8.1 driver - Mailing list pgsql-jdbc

From Michael Paesold
Subject Re: Problem with 8.1 driver
Date
Msg-id 43995155.5000301@gmx.at
Whole thread Raw
In response to Re: Problem with 8.1 driver  (Kris Jurka <books@ejurka.com>)
List 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

pgsql-jdbc by date:

Previous
From: Roshan Nair
Date:
Subject: Passing an array or record to a stored procedure through jdbc
Next
From: Michael Paesold
Date:
Subject: Re: Problem with 8.1 driver