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

From Kris Jurka
Subject Re: Problem with 8.1 driver
Date
Msg-id Pine.BSO.4.61.0512061035180.5324@leary.csoft.net
Whole thread Raw
In response to Re: Problem with 8.1 driver  ("Michael Paesold" <mpaesold@gmx.at>)
Responses Re: Problem with 8.1 driver  (Michael Paesold <mpaesold@gmx.at>)
List pgsql-jdbc

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"));

or you could try this which I have not tested:

PGobject o = new org.postgresql.util.PGobject("1 month");
o.setType("unknown");
stmt.setObject(2, o);

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: bug with 8.X level 4 driver?
Next
From: Kris Jurka
Date:
Subject: Re: JDBC executeUpdate returns 0 for table partitioning rule