Re: PreparedStatement#setString on non-string parameters

Поиск
Список
Период
Сортировка
От Guillaume Cottenceau
Тема Re: PreparedStatement#setString on non-string parameters
Дата
Msg-id 87k6oil1f4.fsf@meuh.mnc.ch
обсуждение исходный текст
Ответ на PreparedStatement#setString on non-string parameters  ("Silvio Bierman" <sbierman@jambo-software.com>)
Список pgsql-jdbc
"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.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
database.
-=-=---=-=---=-=---=-=---=-=--

--
Guillaume Cottenceau

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: PreparedStatement#setString on non-string parameters
Следующее
От: Prajakt Deolasee
Дата:
Сообщение: Postgres is slow