Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Print the query content of PreparedStatement

807603Nov 12 2007 — edited Nov 12 2007
hi all,

Is there any possible to print a PreparedStatement content? I have the following code:
try {
PreparedStatement stmt = this.connection.prepareStatement(
"Insert into table "
+" ( "
+" field1, "
+" field1 "
+" ) "
+" values "
+" ( "
+" ?,"//1
+" ?"//2
+" )"
);
stmt.setInt(1, entrada.getField1());
stmt.setString(2, entrada.getField2());

System.out.println("my query:"+?????);

stmt.execute();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
Edited by: eduacsp on Nov 12, 2007 4:42 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2007
Added on Nov 12 2007
2 comments
258 views