Re: How to get the SQL query from a PreparedStatement?

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: How to get the SQL query from a PreparedStatement?
Дата
Msg-id 47301BAA.1000804@opencloud.com
обсуждение исходный текст
Ответ на How to get the SQL query from a PreparedStatement?  ("Andres Olarte" <olarte.andres@gmail.com>)
Ответы Re: How to get the SQL query from a PreparedStatement?  ("Andres Olarte" <olarte.andres@gmail.com>)
Список pgsql-jdbc
Andres Olarte wrote:

> Is it possible to get the query string (including the formatted
> parameters) from a PreparedStatement?

In general you can't because the query's not sent like that (the
parameter values are sent out of line from the query).

IIRC, PreparedStatement.toString() will give you an approximation, but
I'm not sure how accurate the results are (and it's not part of the spec)

-O

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

Предыдущее
От: Kevin Neufeld
Дата:
Сообщение: Re: Parsed Query Trees
Следующее
От: "Phillip Mills"
Дата:
Сообщение: Beginning tuning