Re: Display SQL from Java Prepared Statement - Mailing list pgsql-jdbc

From Campbell, Lance
Subject Re: Display SQL from Java Prepared Statement
Date
Msg-id B10E6810AC2A2F4EA7550D072CDE876001D20FC4@SAB-FENWICK.sab.uiuc.edu
Whole thread Raw
In response to Re: Display SQL from Java Prepared Statement  ("J. W. Ulbts" <magog001@web.de>)
Responses Re: Display SQL from Java Prepared Statement  (vanayya <nurmi_isnayati@yahoo.com>)
List pgsql-jdbc
J,
I thought I had tried that before.  Good grief that was way to obvious.

I cannot even begin to thank you enough.  Thanks for the response.


Thanks,

Lance Campbell
Project Manager/Software Architect/DBA
Web Services at Public Affairs
217-333-0382

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of J. W. Ulbts
Sent: Sunday, August 23, 2009 11:31 AM
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Display SQL from Java Prepared Statement

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
includesnot 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


--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: "J. W. Ulbts"
Date:
Subject: Re: Display SQL from Java Prepared Statement
Next
From: VSP
Date:
Subject: [Q] Pg text[] array with Hibernate Annotation