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? Oliver Jowett <oliver@opencloud.com>
Re: How to get the SQL query from a PreparedStatement? "Andres Olarte" <olarte.andres@gmail.com>
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
FAQ