org.fluentjdbc.DatabaseStatementFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-jdbc Show documentation
Show all versions of fluent-jdbc Show documentation
A Java library used to execute JDBC statements and build SQL
package org.fluentjdbc;
import java.sql.PreparedStatement;
import java.util.List;
/**
* Controls the creation of {@link DatabaseStatement} objects, which allows for fine custom interception
* that affects all database operations.
*
* Currently not used for the bulk operations {@link DatabaseBulkDeleteBuilder},
* {@link DatabaseBulkUpdatable}, {@link DatabaseBulkInsertBuilder} and {@link DbContext} variations of these
*/
public class DatabaseStatementFactory {
private final DatabaseReporter reporter;
public DatabaseStatementFactory(DatabaseReporter reporter) {
this.reporter = reporter;
}
/**
* Creates a new {@link DatabaseStatement}, giving the context of tableName and operation for logging
* and reporting purposes. The sql parameter is passed to {@link java.sql.Connection#prepareStatement(String)}
* and the parameters are bound with {@link DatabaseStatement#bindParameter(PreparedStatement, int, Object)}
*/
public DatabaseStatement newStatement(String tableName, String operation, String sql, List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy