Re: Prepared Statements

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Prepared Statements
Дата
Msg-id 20030719060623.GA20479@opencloud.com
обсуждение исходный текст
Ответ на Re: Prepared Statements  (Aaron Mulder <ammulder@alumni.princeton.edu>)
Список pgsql-jdbc
On Sat, Jul 19, 2003 at 03:03:20AM -0400, Aaron Mulder wrote:
>     I have to agree that it would be better to provide a solution
> using API calls than a solutions that requires one to send SQL syntax
> into a ?.
>
>     But why can't we kill both birds with an implementation of
> java.sql.Array?  If you need to use an Array, you can use a PGArray that
> wraps an Object[].  If you want to do an in clause, do "where foo in (?)"
> or "where foo in ?" and then use ps.setArray() instead of setObject().
> Then we can make the docs explicit on this.

setArray() needs to generate "'{1,2,3}'" for an array field, but you want
"(1,2,3)" for an IN clause. Requiring the JDBC driver to parse the query to
distinguish the two cases seems awkward.

-O

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

Предыдущее
От: Aaron Mulder
Дата:
Сообщение: Re: Prepared Statements
Следующее
От: pginfo
Дата:
Сообщение: jdbc batch performance problem