From: Oliver Jowett <oliver@opencloud.com>
To: Andres Olarte <olarte.andres@gmail.com>
Cc: Pgsql-Jdbc@Postgresql.Org <pgsql-jdbc@postgresql.org>
Subject: Re: How to get the SQL query from a PreparedStatement?
Date: Tue, 06 Nov 2007 20:45:46 +1300
Message-ID: <47301BAA.1000804@opencloud.com> (raw)
In-Reply-To: <3fccaa690711051819s15082dehd5c67951a6e43dee@mail.gmail.com>
References: <3fccaa690711051819s15082dehd5c67951a6e43dee@mail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, olarte.andres@gmail.com
Subject: Re: How to get the SQL query from a PreparedStatement?
In-Reply-To: <47301BAA.1000804@opencloud.com>
References: <3fccaa690711051819s15082dehd5c67951a6e43dee@mail.gmail.com> <47301BAA.1000804@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox