Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 1121

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.
 
 
subject: Viewing SQL from PreparedStatements
 
Similar Threads
netstat, telnet: TCP/IP connection to localhost 1433 failed
Distributed Txn
Different restults from Oracle and JDBC
Entity Bean - View mapping
select * from ABC where ID in (?)