pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: J. W. Ulbts <magog001@web.de>
To: pgsql-jdbc@postgresql.org
Subject: Re: Display SQL from Java Prepared Statement
Date: Sun, 23 Aug 2009 18:31:12 +0200
Message-ID: <880308007@web.de> (raw)

Hi Lance!

>Is there a way I can have the JDBC driver dump out to a log file all 
> of the SQL statements executed? I am using prepared statements.
> Note: I think the development team is doing a great job.
> Thanks,
> Lance Campbell

Just call the toString() method of the prepared statement object. That will print the prepared statements SQL. It includes not just the SQL command but also some additional text before the SQL command.
I'm using it also to write statements to the log.

Kind regards,
J. Ulbts
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de




view thread (5+ messages)  latest in thread

Message-ID: <880308007@web.de>
Permalink:  ../880308007@web.de/
Also on:    postgresql.org/message-id/880308007@web.de

 · 

reply

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: magog001@web.de
  Subject: Re: Display SQL from Java Prepared Statement
  In-Reply-To: <880308007@web.de>
  References: <880308007@web.de>

* 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