File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes PreparedStatement and above Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "PreparedStatement and above" Watch "PreparedStatement and above" New topic
Author

PreparedStatement and above

Manoj Pooleery
Ranch Hand

Joined: Sep 20, 2000
Posts: 35
Hi All,
I want to see the SQL statement inside a PreparedStatement just before it is executed. (After the values have been set). Anybody got any idea as to how to display it?
TIA
Manoj.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
It doesn't work that way. The PreparedStatement is sent to the database prior to having the variables loaded for precompiling. The variables are then sent for execution. JDBC doesn't replace the question marks with your variables. That is happening at the database.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PreparedStatement and above