How can I find all the SQL updates that are running in a Java connection (from transaction start to validation)?

advertisements

How can I find all the SQL update queries run in a Java Connection (from transaction start to commit)?


You can't do that with a normal Connection.

You could create wrapper classes for the actual Connection/Statement classes, that would track which statements have been executed. A better idea would be to just enable logging of SQL if your driver supports it, otherwise you're just recreating an existing functionality.