Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group