It's all about the answers!

Ask a question

Getting actual SQL query


Kazuki Nobutani (411621) | asked Mar 27 '17, 2:02 a.m.

Hello,

I found out that using repodebug feature, you can get SQL query generated by the app.
However the query collected in the repodebug contains '?' which is not the actual query executed on my DB2.
Does anyone know any way to know the actual query executed?

Thank you in advance.

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Mar 31 '17, 1:33 a.m.

That is the way it is. You cannot get more "actual" than that. Further reading is shown below.
https://en.wikipedia.org/wiki/Prepared_statement
http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html

Kazuki Nobutani selected this answer as the correct answer

Comments
Kazuki Nobutani commented Apr 03 '17, 1:48 a.m.

Thank you Donald, I found out that with DB2, seems like you can capture actual queries using "AUDIT POLICY" using a parameter of "EXECUTE WITH DATA".

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.