Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java.sql.PreparedStatement

Status
Not open for further replies.

Hattusas

Programmer
Nov 11, 2001
344
TR
I need to find the sql statement of my prepared statement. How can I do that?

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
 
I don't think you can.

The point of a PreparedStatement is that the PreparedStatement and parameters are sent to the SQL server separately, where they're compiled into the actual SQL statement to use. That way, reusing the same PreparedStatement speeds up the execution time of the SQL statement, because it's already been compiled. The SQL server only needs to plug the new parameters in.

So I don't think the client is actually aware of the final form of the SQL statement.

The best you could do is a toString() on the PreparedStatement.
 
if you're doing debugging...look on the Oracle side for the exact statement that was passed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top