From: Guillaume Cottenceau <gc@mnc.ch>
To: Silvio Bierman <sbierman@jambo-software.com>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: PreparedStatement#setString on non-string parameters
Date: 08 Mar 2005 14:20:15 +0100
Message-ID: <87k6oil1f4.fsf@meuh.mnc.ch> (raw)
In-Reply-To: <JGEOKLDJHLJNAPFIBKBNCEICDCAA.sbierman@jambo-software.com>
References: <JGEOKLDJHLJNAPFIBKBNCEICDCAA.sbierman@jambo-software.com>
"Silvio Bierman" <sbierman 'at' jambo-software.com> 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
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html
-=-=---=-=---=-=---=-=---=-=--
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
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#setString(int,%20java.lang.S...)
-=-=---=-=---=-=---=-=---=-=--
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
database.
-=-=---=-=---=-=---=-=---=-=--
--
Guillaume Cottenceau
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: gc@mnc.ch, sbierman@jambo-software.com
Subject: Re: PreparedStatement#setString on non-string parameters
In-Reply-To: <87k6oil1f4.fsf@meuh.mnc.ch>
References: <JGEOKLDJHLJNAPFIBKBNCEICDCAA.sbierman@jambo-software.com> <87k6oil1f4.fsf@meuh.mnc.ch>
* 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