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

Re: PreparedStatement#setString on non-string parameters

From: Guillaume Cottenceau <gc(at)mnc(dot)ch>
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 13:20:15
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
"Silvio Bierman" <sbierman 'at'> writes:


> 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?

Where can you see that?

I can see pretty much the opposite, for example the following at

Note: The setter methods (setShort, setString, and so on) for
setting IN parameter values must specify types that are
compatible with the defined SQL type of the input parameter. For
instance, if the IN parameter has SQL type INTEGER, then the
method setInt should be used.

And even, at,%20java.lang.String)

setString: The driver converts this to an SQL VARCHAR or
LONGVARCHAR value (depending on the argument's size relative to
the driver's limits on VARCHAR values) when it sends it to the

Guillaume Cottenceau

In response to

pgsql-jdbc by date

Next:From: Prajakt DeolaseeDate: 2005-03-08 13:49:05
Subject: Postgres is slow
Previous:From: Dave CramerDate: 2005-03-08 13:09:35
Subject: Re: PreparedStatement#setString on non-string parameters

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