Top Description Fields Constructors Methods
org.jooq.tools.jdbc

public Class BatchedConnection

extends DefaultConnection
Class Inheritance
Static Imports
java.util.Collections.emptyMap, org.jooq.tools.jdbc.JDBCUtils.safeClose

Deprecated

as a consequence of DefaultConnection being deprecated. See corresponding docs for further information.

A batching connection.

This connection buffers consecutive identical prepared statements for DELETE, INSERT, MERGE, UPDATE statements, instead of allowing for them to be executed directly.

Calls to PreparedStatement#executeUpdate() or PreparedStatement#execute() are replaced by PreparedStatement#addBatch(). The update count of such operations is always zero, and cannot be retrieved later on. When any of the following events happen, the batch is executed using Statement#executeBatch():

Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv String
pack-priv BatchedPreparedStatement
lastStatement

Deprecated as a consequence of BatchedPreparedStatement being deprecated.
pack-priv static final Pattern

Constructor Summary

AccessConstructor and Description
public
public
BatchedConnection(Connection delegate, int batchSize)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
clearWarnings()

Overrides org.jooq.tools.jdbc.DefaultConnection.clearWarnings.

Implements java.sql.Connection.clearWarnings.

Clears all warnings reported for this Connection object.
public void
close()

Overrides org.jooq.tools.jdbc.DefaultConnection.close.

Implements java.sql.Connection.close.

Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.
public void
commit()

Overrides org.jooq.tools.jdbc.DefaultConnection.commit.

Implements java.sql.Connection.commit.

Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.
public Statement
createStatement()

Overrides org.jooq.tools.jdbc.DefaultConnection.createStatement.

Implements java.sql.Connection.createStatement.

Creates a Statement object for sending SQL statements to the database.
public Statement
createStatement(int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Overrides org.jooq.tools.jdbc.DefaultConnection.createStatement.

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.
public Statement
createStatement(int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Overrides org.jooq.tools.jdbc.DefaultConnection.createStatement.

Implements java.sql.Connection.createStatement.

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
pack-priv void
pack-priv void
public boolean
getAutoCommit()

Overrides org.jooq.tools.jdbc.DefaultConnection.getAutoCommit.

Implements java.sql.Connection.getAutoCommit.

Retrieves the current auto-commit mode for this Connection object.
public String
getCatalog()

Overrides org.jooq.tools.jdbc.DefaultConnection.getCatalog.

Implements java.sql.Connection.getCatalog.

Retrieves this Connection object's current catalog name.
public String
getClientInfo(String
The name of the client info property to retrieve
name
)

Overrides org.jooq.tools.jdbc.DefaultConnection.getClientInfo.

Implements java.sql.Connection.getClientInfo.

Returns the value of the client info property specified by name.
public Properties
getClientInfo()

Overrides org.jooq.tools.jdbc.DefaultConnection.getClientInfo.

Implements java.sql.Connection.getClientInfo.

Returns a list containing the name and current value of each client info property supported by the driver.
public int
getHoldability()

Overrides org.jooq.tools.jdbc.DefaultConnection.getHoldability.

Implements java.sql.Connection.getHoldability.

Retrieves the current holdability of ResultSet objects created using this Connection object.
public int
getTransactionIsolation()

Overrides org.jooq.tools.jdbc.DefaultConnection.getTransactionIsolation.

Implements java.sql.Connection.getTransactionIsolation.

Retrieves this Connection object's current transaction isolation level.
public Map<String, Class<?>>
getTypeMap()

Overrides org.jooq.tools.jdbc.DefaultConnection.getTypeMap.

Implements java.sql.Connection.getTypeMap.

Retrieves the Map object associated with this Connection object.
public SQLWarning
getWarnings()

Overrides org.jooq.tools.jdbc.DefaultConnection.getWarnings.

Implements java.sql.Connection.getWarnings.

Retrieves the first warning reported by calls on this Connection object.
public boolean
isReadOnly()

Overrides org.jooq.tools.jdbc.DefaultConnection.isReadOnly.

Implements java.sql.Connection.isReadOnly.

Retrieves whether this Connection object is in read-only mode.
public boolean
isValid(int
The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operationcompletes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.
timeout
)

Overrides org.jooq.tools.jdbc.DefaultConnection.isValid.

Implements java.sql.Connection.isValid.

Returns true if the connection has not been closed and is still valid.
public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Overrides org.jooq.tools.jdbc.DefaultConnection.isWrapperFor.

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
public CallableStatement
prepareCall(String
an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is specified using JDBC call escape syntax.
sql
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareCall.

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object for calling database stored procedures.
public CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareCall.

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
public CallableStatement
prepareCall(String
a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareCall.

Implements java.sql.Connection.prepareCall.

Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
public PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.
public PreparedStatement
prepareStatement(String
a String object that is the SQL statement to be sent to the database; may contain one or more '?' IN parameters
sql
,
int
one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetType
,
int
one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetConcurrency
,
int
one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
resultSetHoldability
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int
a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
autoGeneratedKeys
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys.
public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
int[]
an array of column indexes indicating the columns that should be returned from the inserted row or rows
columnIndexes
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
,
String[]
an array of column names indicating the columns that should be returned from the inserted row or rows
columnNames
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array.
public PreparedStatement
prepareStatement(String
an SQL statement that may contain one or more '?' IN parameter placeholders
sql
)

Overrides org.jooq.tools.jdbc.DefaultConnection.prepareStatement.

Implements java.sql.Connection.prepareStatement.

Creates a PreparedStatement object for sending parameterized SQL statements to the database.
private PreparedStatement
public void
releaseSavepoint(Savepoint
the Savepoint object to be removed
savepoint
)

Overrides org.jooq.tools.jdbc.DefaultConnection.releaseSavepoint.

Implements java.sql.Connection.releaseSavepoint.

Removes the specified Savepoint and subsequent Savepoint objects from the current transaction.
public void
rollback()

Overrides org.jooq.tools.jdbc.DefaultConnection.rollback.

Implements java.sql.Connection.rollback.

Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.
public void
rollback(Savepoint
the Savepoint object to roll back to
savepoint
)

Overrides org.jooq.tools.jdbc.DefaultConnection.rollback.

Implements java.sql.Connection.rollback.

Undoes all changes made after the given Savepoint object was set.
public void
setAutoCommit(boolean
true to enable auto-commit mode; false to disable it
autoCommit
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setAutoCommit.

Implements java.sql.Connection.setAutoCommit.

Sets this connection's auto-commit mode to the given state.
pack-priv void
setBatch(BatchedPreparedStatement s)

Deprecated as a consequence of BatchedPreparedStatement being deprecated.
public void
setCatalog(String
the name of a catalog (subspace in this Connection object's database) in which to work
catalog
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setCatalog.

Implements java.sql.Connection.setCatalog.

Sets the given catalog name in order to select a subspace of this Connection object's database in which to work.
public void
setClientInfo(String
The name of the client info property to set
name
,
String
The value to set the client info property to. If the value is null, the current value of the specified property is cleared.
value
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setClientInfo.

Implements java.sql.Connection.setClientInfo.

Sets the value of the client info property specified by name to the value specified by value.
public void
setClientInfo(Properties
the list of client info properties to set
properties
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setClientInfo.

Implements java.sql.Connection.setClientInfo.

Sets the value of the connection's client info properties.
public void
setHoldability(int
a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
holdability
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setHoldability.

Implements java.sql.Connection.setHoldability.

Changes the default holdability of ResultSet objects created using this Connection object to the given holdability.
public void
setReadOnly(boolean
true enables read-only mode; false disables it
readOnly
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setReadOnly.

Implements java.sql.Connection.setReadOnly.

Puts this connection in read-only mode as a hint to the driver to enable database optimizations.
public Savepoint
setSavepoint()

Overrides org.jooq.tools.jdbc.DefaultConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it.
public Savepoint
setSavepoint(String
a String containing the name of the savepoint
name
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setSavepoint.

Implements java.sql.Connection.setSavepoint.

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it.
public void
setTransactionIsolation(int
one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE. (Note that Connection.TRANSACTION_NONE cannot be used because it specifies that transactions are not supported.)
level
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setTransactionIsolation.

Implements java.sql.Connection.setTransactionIsolation.

Attempts to change the transaction isolation level for this Connection object to the one given.
public void
setTypeMap(Map<String, Class<?>>
the java.util.Map object to install as the replacement for this Connection object's default type map
map
)

Overrides org.jooq.tools.jdbc.DefaultConnection.setTypeMap.

Implements java.sql.Connection.setTypeMap.

Installs the given TypeMap object as the type map for this Connection object.
public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Overrides org.jooq.tools.jdbc.DefaultConnection.unwrap.

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
Inherited from org.jooq.tools.jdbc.DefaultConnection:
abortbeginRequestcreateArrayOfcreateBlobcreateClobcreateNClobcreateSQLXMLcreateStructendRequestgetDelegategetMetaDatagetNetworkTimeoutgetSchemaisClosednativeSQLsetNetworkTimeoutsetSchemasetShardingKeysetShardingKeysetShardingKeyIfValidsetShardingKeyIfValid