This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Similar Threads
Problem with quotes (escape characters)
error of missing values
Update query
How to insert records at run time?
jdbc