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 URGENT !!! how do i  find query string in prepared stmt ??? 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 "URGENT !!! how do i  find query string in prepared stmt ???" Watch "URGENT !!! how do i  find query string in prepared stmt ???" New topic
Author

URGENT !!! how do i find query string in prepared stmt ???

Tejas Tambe
Ranch Hand

Joined: Oct 08, 2001
Posts: 47
Hi guyz...
Can any 1 tell me how to find out the query string generated by prepared statement, before execution.
with thanx in adavance...
Tejas
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Tejas Tambe:
Hi guyz...
Can any 1 tell me how to find out the query string generated by prepared statement, before execution.
with thanx in adavance...
Tejas

No fast way to do this. You've got to just use System.out.println on the query String used to prepare the PreparedStatement, and then printout all the values you set. Manually you can replace the question marks with the actual values ( adding single quotes where necessary ).
Jamie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URGENT !!! how do i find query string in prepared stmt ???
 
Similar Threads
Passing Table Names in PreparedStatement
does OracleDriver really precompile a PreparedStatement?
SQLException problem?
database
using prepare statements