Re: Problem with 8.1 driver

From: Kris Jurka <books(at)ejurka(dot)com>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with 8.1 driver
Date: 2005-12-06 15:37:45
Message-ID: Pine.BSO.4.61.0512061035180.5324@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-12-06 15:47:46 Re: JDBC executeUpdate returns 0 for table partitioning rule
Previous Message Kris Jurka 2005-12-06 15:34:06 Re: bug with 8.X level 4 driver?