File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Java » Java in General
Bookmark "WrappedPreparedStatementJDK6 get SQL query." Watch "WrappedPreparedStatementJDK6 get SQL query." New topic
Author

WrappedPreparedStatementJDK6 get SQL query.

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


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 BlackBeltFactory.com.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


Thanks thats what I was looking for.
The parameters could be found easily goin on a DEBUG mode.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WrappedPreparedStatementJDK6 get SQL query.