aspose file tools*
The moose likes JDBC and the fly likes Viewing SQL from PreparedStatements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Viewing SQL from PreparedStatements" Watch "Viewing SQL from PreparedStatements" New topic
Author

Viewing SQL from PreparedStatements

Ben Klug
Ranch Hand

Joined: Jan 28, 2002
Posts: 45
Hi,

is there a way to view the SQL-Statement that was created from a PreparedStatement? I'd like to view it filled with parameters instead of ?'s for debug reasons.

Thanks, b.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You almost answered your own question
Search for DebuggableStatement
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Ben,
Perhaps P6 Spy will be of help.

David,
Were you referring to the JavaWorld article entitled Overpower the PreparedStatement?

Good Luck,
Avi.
[ February 14, 2005: Message edited by: Avi Abrami ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

That's the one. I've found it very useful many times.
 
wood burning stoves
 
subject: Viewing SQL from PreparedStatements