Back to performance issues for a moment... (RE: Prepared Statements)

Поиск
Список
Период
Сортировка
От Nick Fankhauser
Тема Back to performance issues for a moment... (RE: Prepared Statements)
Дата
Msg-id NEBBLAAHGLEEPCGOBHDGMEHJHMAA.nickf@ontko.com
обсуждение исходный текст
Ответ на Re: Prepared Statements  (Fernando Nasser <fnasser@redhat.com>)
Ответы Re: Back to performance issues for a moment... (RE: Prepared  (Barry Lind <blind@xythos.com>)
Список pgsql-jdbc
> In any case, try using server prepared statements by setting your
statement to
> use that option (you must be using a backend at least of version 7.3):
>
> setUseServerPrepare(true);

Hi folks-

Sorry to pull things backward here, but having set my web user up with sane
grants, I'm a bit more concerned about the performance issues- I can't find
this method in the Sun JDBC spec, so I'm assuming it is PostgreSQL-specific?

Is this the correct way to use it:

 PreparedStatement ps = db.prepareStatement("select foo from bar where foo
like ?");
 ps.setUseServerPrepare(true);
 .
 .
 .
 ps.setString(1, "fubar");
 ResultSet rs = ps.executeQuery();

(Where the first two lines get executed once when I init my app, but the
last two lines may get executed any number of times.)

Also- is the javadoc for postgresql JDBC online anywhere for folks like
myself who just download the current stable jarfile?

Thanks
     -NF


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

Предыдущее
От: Erik Price
Дата:
Сообщение: Re: Prepared Statements
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Re: Prepared Statements