Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PreparedStatement and above

 
Manoj Pooleery
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to see the SQL statement inside a PreparedStatement just before it is executed. (After the values have been set). Anybody got any idea as to how to display it?
TIA
Manoj.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't work that way. The PreparedStatement is sent to the database prior to having the variables loaded for precompiling. The variables are then sent for execution. JDBC doesn't replace the question marks with your variables. That is happening at the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic