From a66639c7f9bf6dd2bc4ba7f497539376f1dbe650 Mon Sep 17 00:00:00 2001
From: Lukas Eder
For convenience and better backwards-compatibility, consider extending
Here is a sample implementation of an ExecuteListener, that is simply counting the number of queries per type that are being executed using jOOQ:
Example: Query statistics ExecuteListener
The following depicts an example of a custom ExecuteListener, which pretty-prints all queries being executed by jOOQ to stdout:
@@ -8777,6 +8779,27 @@ public class PrettyPrinter extends DefaultExecuteListener {
See also the manual's sections about
+ You can also use ExecuteListeners to interact with your SQL statements, for instance when you want to check if executed or statements contain a WHERE clause. This can be achieved trivially with the following sample ExecuteListener:
+
+ You might want to replace the above implementation with a more efficient and more reliable one, of course. +