File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes WrappedPreparedStatementJDK6 get SQL query. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "WrappedPreparedStatementJDK6 get SQL query." Watch "WrappedPreparedStatementJDK6 get SQL query." New topic

WrappedPreparedStatementJDK6 get SQL query.

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443

I have a WrappedPreparedStatementJDK6 being used to which I need to make a few modifications. To start with I want to know the SQL query inside this PreparedStatement. How can I get to know this?
Ramon Anger
Ranch Hand

Joined: Apr 19, 2011
Posts: 56

You could debug your statement execution.
Maybe the method getUnderlyingStatement() from WrappedPreparedStatement contains an info on the sql statement itself but this would probably be without parameter replacement.

Blackbelt on
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443

Thanks thats what I was looking for.
The parameters could be found easily goin on a DEBUG mode.
subject: WrappedPreparedStatementJDK6 get SQL query.
Similar Threads
Problem Named Queries In Hibernate
want toknow all the object names in a database
SQL Server limiting result set
SQLException:Invalid column name
tables in the database