Class RecordingDataSource

java.lang.Object
org.approvej.database.jdbc.RecordingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

@NullMarked public class RecordingDataSource extends Object implements DataSource
A DataSource wrapper that records all SQL statements executed through it.

Wrap your application's DataSource with this to capture the SQL your code sends. Then approve the recorded queries to catch unintended changes.

This is analogous to the HTTP module's HttpStubServer: instead of intercepting HTTP requests, it intercepts SQL statements.

SQL is recorded at execution time. For PreparedStatements, the SQL template (with ? placeholders) is recorded each time the statement is executed.