Re: PreparedStatement#setString on non-string parameters

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: PreparedStatement#setString on non-string parameters
Дата
Msg-id 422E17D5.9080109@opencloud.com
обсуждение исходный текст
Ответ на PreparedStatement#setString on non-string parameters  ("Silvio Bierman" <sbierman@jambo-software.com>)
Список 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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres is slow
Следующее
От: "Silvio Bierman"
Дата:
Сообщение: FW: PreparedStatement#setString on non-string parameters