pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Michael Paesold <mpaesold@gmx.at>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with 8.1 driver
Date: Tue, 6 Dec 2005 10:37:45 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0512061035180.5324@leary.csoft.net> (raw)
In-Reply-To: <00b001c5fa45$123f1a60$0f01a8c0@zaphod>
References: <024401c5f9da$537c29c0$0f01a8c0@zaphod>
	<Pine.BSO.4.61.0512051715450.781@leary.csoft.net>
	<00b001c5fa45$123f1a60$0f01a8c0@zaphod>



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



view thread (7+ messages)  latest in thread

Message-ID: <Pine.BSO.4.61.0512061035180.5324@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0512061035180.5324@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0512061035180.5324@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, mpaesold@gmx.at
  Subject: Re: Problem with 8.1 driver
  In-Reply-To: <Pine.BSO.4.61.0512061035180.5324@leary.csoft.net>
  References: <024401c5f9da$537c29c0$0f01a8c0@zaphod> <Pine.BSO.4.61.0512051715450.781@leary.csoft.net> <00b001c5fa45$123f1a60$0f01a8c0@zaphod> <Pine.BSO.4.61.0512061035180.5324@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox