EDIT: I am using Oracle
I am Writing a dynamic query using PreparedStatement
which goes something like this
String query="UPDATE <tablename> SET
column1=?,column2=?,.....,coulmn7=? WHERE "
+ "column5=TO_DATE(?,'DD/MM/YYYY') AND "
+ "column6=? AND "
....
+ "column7=?";
PreparedStatement prest2=con2.PrepareThisStatement(query);
while(true){
//loop through and bind values
if(end of list) break;
}
prest2.executeUpdate(query);
I need to keep the track of the queries that get fired at the database and log them in a table.
But I cannot get the entire query when using the PreparedStatement
, nor can I store the values in a separate field. Is there a way to get the final query that was fired at the database.