Re: PreparedStatement#setString on non-string parameters

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Silvio Bierman <sbierman(at)jambo-software(dot)com>
Cc: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement#setString on non-string parameters
Date: 2005-03-08 21:23:33
Message-ID: 422E17D5.9080109@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Silvio Bierman wrote:

> The JDBC spec requires the driver to attempt a conversion when a
> setString is done on a non-string parameter. This will break a lot of
> conformant code, not only ours. Is there any chance this can be corrected?

AFAIK, the spec doesn't require this. Can you point me at the bit of the
spec that makes you think it does?

As I read the spec, the only conversions the driver performs for IN
parameters are those in table B-2 (for String, to
CHAR/VARCHAR/LONGVARCHAR) or B-4 (same mapping for String). See 13.2.2.1
and 13.2.2.2 of the JDBC 3.0 spec.

There is a wider set of conversions available on the ResultSet path
(notably, integer -> string) -- see 14.2.3.1 and table B-6.

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Silvio Bierman 2005-03-08 21:23:41 FW: PreparedStatement#setString on non-string parameters
Previous Message Tom Lane 2005-03-08 19:36:52 Re: Postgres is slow