ExecuteListener
is a base type for loggers, debuggers, profilers, data collectors that can be hooked into a jOOQ {@link Factory}using the {@link Settings#getExecuteListeners()} property, passingSettings
to {@link Factory#Factory(java.sql.Connection,SQLDialect,Settings)}. Advanced ExecuteListeners
can also provide custom implementations of {@link Connection}, {@link PreparedStatement} and {@link ResultSet} to jOOQin apropriate methods. For convenience, consider extending {@link DefaultExecuteListener} instead of implementing this interface. Thiswill prevent compilation errors in future versions of jOOQ, when this interface might get new methods.
The following table explains how every type of statement / operation invokes callback methods in the correct order for all registered ExecuteListeners
. Find a legend below the table for the various use cases.
Callback method | Use case [1] | Use case [2] | Use case [3] | Use case [4] | Use case [5] | Use case [6] |
---|---|---|---|---|---|---|
{@link #start(ExecuteContext)} | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x |
{@link #renderStart(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, Nx (for every query) | Yes, 1x |
{@link #renderEnd(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, Nx (for every query) | Yes, 1x |
{@link #prepareStart(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, Nx (for every query) | Yes, 1x |
{@link #prepareEnd(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, Nx (for every query) | Yes, 1x |
{@link #bindStart(ExecuteContext)} | Yes, 1x | No | No | Yes, Nx (for every value set) | No | Yes, 1x |
{@link #bindEnd(ExecuteContext)} | Yes, 1x | No | No | Yes, Nx (for every value set) | No | Yes, 1 |
{@link #executeStart(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, 1x | Yes, 1x |
{@link #executeEnd(ExecuteContext)} | Yes, 1x | Yes, 1x | No | Yes, 1x | Yes, 1x | Yes, 1x |
{@link #fetchStart(ExecuteContext)} | Yes, 1x (Nx for {@link ResultQuery#fetchMany()} | Yes, 1x (Nx for {@link ResultQuery#fetchMany()} | Yes, 1x | No | No | No |
{@link #resultStart(ExecuteContext)} | Yes, 1x (Nx for {@link Cursor#fetch(int)} | Yes, 1x (Nx for {@link Cursor#fetch(int)} | Yes, 1x | No | No | No |
{@link #recordStart(ExecuteContext)} | Yes, Nx | Yes, Nx | Yes, Nx | No | No | No |
{@link #recordEnd(ExecuteContext)} | Yes, Nx | Yes, Nx | Yes, Nx | No | No | No |
{@link #resultEnd(ExecuteContext)} | Yes, 1x (Nx for {@link Cursor#fetch(int)} | Yes, 1x (Nx for {@link Cursor#fetch(int)} | Yes, 1x | No | No | No |
{@link #fetchEnd(ExecuteContext)} | Yes, 1x (Nx for {@link ResultQuery#fetchMany()} | Yes, 1x (Nx for {@link ResultQuery#fetchMany()} | Yes, 1x | No | No | No |
{@link #end(ExecuteContext)} | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x | Yes, 1x |
If nothing is specified, the default is to use {@link LoggerListener} and{@link StopWatchListener} as the only event listeners. @author Lukas Eder
|
|
|
|
|
|