A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Get SQL value out of PreparedStatement - Any API
Joined: Jul 21, 2003
Feb 17, 2006 15:23:00
Is there a way to get the SQL out of a PreparedStatement?
PreparedStatement prepStmnt = conn.prepareStatement("select * from table");
Is there any API that will let me extract the sql that is the inherent part of prepStmnt.
Goal is to get "select * from table" value out of prepStmnt variable.
Joined: Dec 15, 2005
Feb 17, 2006 17:09:00
Not in standard
Some drivers may have vendor-supplied add-ons to do that.
Some people create "wrapper" classes that will store the SQL and the bind variable values and give them up on request.
Joined: Mar 06, 2001
Feb 17, 2006 18:10:00
If you search this forum for 'DebuggableStatement' it will give you one option of that type, and links to a few more.
subject: Get SQL value out of PreparedStatement - Any API
Can PreparedStatements take care of this ?
Update D/b with Java variable
Can I use prep.execute to update a record?
SetNull in a PreparedStatement
help! perhaps the problems of configuration of JDBC on Weblogic
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014