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

From J. W. Ulbts
Subject Re: Display SQL from Java Prepared Statement
Date
Msg-id 880308007@web.de
Whole thread Raw
In response to Display SQL from Java Prepared Statement  ("Campbell, Lance" <lance@illinois.edu>)
Responses Re: Display SQL from Java Prepared Statement  ("Campbell, Lance" <lance@illinois.edu>)
List pgsql-jdbc
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


pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hibernate and Postgres 8.3/8.4
Next
From: "Campbell, Lance"
Date:
Subject: Re: Display SQL from Java Prepared Statement