- java.lang.Object
- 
- org.jooq.tools.jdbc.JDBC41Connection
- 
- org.jooq.tools.jdbc.DefaultConnection
- 
- org.jooq.tools.jdbc.BatchedConnection
 
 
 
- 
- All Implemented Interfaces:
- AutoCloseable,- Connection,- Wrapper
 
 public class BatchedConnection extends DefaultConnection A batching connection.This connection buffers consecutive identical prepared statements for DELETE,INSERT,MERGE,UPDATEstatements, instead of allowing for them to be executed directly.Calls to PreparedStatement.executeUpdate()orPreparedStatement.execute()are replaced byPreparedStatement.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 usingStatement.executeBatch():- The close()method is called (the call is not delegated to the wrapped connection).
- A Connection.prepareStatement(String)call is made with a different SQL string.
- Any other type of statement is created or other API is called, such as
 commit().
 - Author:
- Lukas Eder
 
- 
- 
Field Summary- 
Fields inherited from interface java.sql.ConnectionTRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
- 
 - 
Constructor SummaryConstructors Constructor Description BatchedConnection(Connection delegate)BatchedConnection(Connection delegate, int batchSize)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearWarnings()voidclose()voidcommit()StatementcreateStatement()StatementcreateStatement(int resultSetType, int resultSetConcurrency)StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)booleangetAutoCommit()StringgetCatalog()PropertiesgetClientInfo()StringgetClientInfo(String name)intgetHoldability()intgetTransactionIsolation()Map<String,Class<?>>getTypeMap()SQLWarninggetWarnings()booleanisReadOnly()booleanisValid(int timeout)booleanisWrapperFor(Class<?> iface)CallableStatementprepareCall(String sql)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql)PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)PreparedStatementprepareStatement(String sql, int[] columnIndexes)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql, String[] columnNames)voidreleaseSavepoint(Savepoint savepoint)voidrollback()voidrollback(Savepoint savepoint)voidsetAutoCommit(boolean autoCommit)voidsetCatalog(String catalog)voidsetClientInfo(String name, String value)voidsetClientInfo(Properties properties)voidsetHoldability(int holdability)voidsetReadOnly(boolean readOnly)SavepointsetSavepoint()SavepointsetSavepoint(String name)voidsetTransactionIsolation(int level)voidsetTypeMap(Map<String,Class<?>> map)<T> Tunwrap(Class<T> iface)- 
Methods inherited from class org.jooq.tools.jdbc.DefaultConnectionabort, beginRequest, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, endRequest, getDelegate, getMetaData, getNetworkTimeout, getSchema, isClosed, nativeSQL, setNetworkTimeout, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
 
- 
 
- 
- 
- 
Constructor Detail- 
BatchedConnectionpublic BatchedConnection(Connection delegate) 
 - 
BatchedConnectionpublic BatchedConnection(Connection delegate, int batchSize) 
 
- 
 - 
Method Detail- 
unwrappublic <T> T unwrap(Class<T> iface) throws SQLException - Specified by:
- unwrapin interface- Wrapper
- Overrides:
- unwrapin class- DefaultConnection
- Throws:
- SQLException
 
 - 
isWrapperForpublic boolean isWrapperFor(Class<?> iface) throws SQLException - Specified by:
- isWrapperForin interface- Wrapper
- Overrides:
- isWrapperForin class- DefaultConnection
- Throws:
- SQLException
 
 - 
createStatementpublic Statement createStatement() throws SQLException - Specified by:
- createStatementin interface- Connection
- Overrides:
- createStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
createStatementpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
- createStatementin interface- Connection
- Overrides:
- createStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
createStatementpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
- createStatementin interface- Connection
- Overrides:
- createStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareCallpublic CallableStatement prepareCall(String sql) throws SQLException - Specified by:
- prepareCallin interface- Connection
- Overrides:
- prepareCallin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareCallpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
- prepareCallin interface- Connection
- Overrides:
- prepareCallin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareCallpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
- prepareCallin interface- Connection
- Overrides:
- prepareCallin class- DefaultConnection
- Throws:
- SQLException
 
 - 
prepareStatementpublic PreparedStatement prepareStatement(String sql) throws SQLException - Specified by:
- prepareStatementin interface- Connection
- Overrides:
- prepareStatementin class- DefaultConnection
- Throws:
- SQLException
 
 - 
commitpublic void commit() throws SQLException- Specified by:
- commitin interface- Connection
- Overrides:
- commitin class- DefaultConnection
- Throws:
- SQLException
 
 - 
rollbackpublic void rollback() throws SQLException- Specified by:
- rollbackin interface- Connection
- Overrides:
- rollbackin class- DefaultConnection
- Throws:
- SQLException
 
 - 
rollbackpublic void rollback(Savepoint savepoint) throws SQLException - Specified by:
- rollbackin interface- Connection
- Overrides:
- rollbackin class- DefaultConnection
- Throws:
- SQLException
 
 - 
closepublic void close() throws SQLException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Connection
- Overrides:
- closein class- DefaultConnection
- Throws:
- SQLException
 
 - 
setSavepointpublic Savepoint setSavepoint() throws SQLException - Specified by:
- setSavepointin interface- Connection
- Overrides:
- setSavepointin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setSavepointpublic Savepoint setSavepoint(String name) throws SQLException - Specified by:
- setSavepointin interface- Connection
- Overrides:
- setSavepointin class- DefaultConnection
- Throws:
- SQLException
 
 - 
releaseSavepointpublic void releaseSavepoint(Savepoint savepoint) throws SQLException - Specified by:
- releaseSavepointin interface- Connection
- Overrides:
- releaseSavepointin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setAutoCommitpublic void setAutoCommit(boolean autoCommit) throws SQLException- Specified by:
- setAutoCommitin interface- Connection
- Overrides:
- setAutoCommitin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getAutoCommitpublic boolean getAutoCommit() throws SQLException- Specified by:
- getAutoCommitin interface- Connection
- Overrides:
- getAutoCommitin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setReadOnlypublic void setReadOnly(boolean readOnly) throws SQLException- Specified by:
- setReadOnlyin interface- Connection
- Overrides:
- setReadOnlyin class- DefaultConnection
- Throws:
- SQLException
 
 - 
isReadOnlypublic boolean isReadOnly() throws SQLException- Specified by:
- isReadOnlyin interface- Connection
- Overrides:
- isReadOnlyin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setCatalogpublic void setCatalog(String catalog) throws SQLException - Specified by:
- setCatalogin interface- Connection
- Overrides:
- setCatalogin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getCatalogpublic String getCatalog() throws SQLException - Specified by:
- getCatalogin interface- Connection
- Overrides:
- getCatalogin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getWarningspublic SQLWarning getWarnings() throws SQLException - Specified by:
- getWarningsin interface- Connection
- Overrides:
- getWarningsin class- DefaultConnection
- Throws:
- SQLException
 
 - 
clearWarningspublic void clearWarnings() throws SQLException- Specified by:
- clearWarningsin interface- Connection
- Overrides:
- clearWarningsin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setTransactionIsolationpublic void setTransactionIsolation(int level) throws SQLException- Specified by:
- setTransactionIsolationin interface- Connection
- Overrides:
- setTransactionIsolationin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getTransactionIsolationpublic int getTransactionIsolation() throws SQLException- Specified by:
- getTransactionIsolationin interface- Connection
- Overrides:
- getTransactionIsolationin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setTypeMappublic void setTypeMap(Map<String,Class<?>> map) throws SQLException - Specified by:
- setTypeMapin interface- Connection
- Overrides:
- setTypeMapin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getTypeMappublic Map<String,Class<?>> getTypeMap() throws SQLException - Specified by:
- getTypeMapin interface- Connection
- Overrides:
- getTypeMapin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setHoldabilitypublic void setHoldability(int holdability) throws SQLException- Specified by:
- setHoldabilityin interface- Connection
- Overrides:
- setHoldabilityin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getHoldabilitypublic int getHoldability() throws SQLException- Specified by:
- getHoldabilityin interface- Connection
- Overrides:
- getHoldabilityin class- DefaultConnection
- Throws:
- SQLException
 
 - 
isValidpublic boolean isValid(int timeout) throws SQLException- Specified by:
- isValidin interface- Connection
- Overrides:
- isValidin class- DefaultConnection
- Throws:
- SQLException
 
 - 
setClientInfopublic void setClientInfo(String name, String value) throws SQLClientInfoException - Specified by:
- setClientInfoin interface- Connection
- Overrides:
- setClientInfoin class- DefaultConnection
- Throws:
- SQLClientInfoException
 
 - 
setClientInfopublic void setClientInfo(Properties properties) throws SQLClientInfoException - Specified by:
- setClientInfoin interface- Connection
- Overrides:
- setClientInfoin class- DefaultConnection
- Throws:
- SQLClientInfoException
 
 - 
getClientInfopublic String getClientInfo(String name) throws SQLException - Specified by:
- getClientInfoin interface- Connection
- Overrides:
- getClientInfoin class- DefaultConnection
- Throws:
- SQLException
 
 - 
getClientInfopublic Properties getClientInfo() throws SQLException - Specified by:
- getClientInfoin interface- Connection
- Overrides:
- getClientInfoin class- DefaultConnection
- Throws:
- SQLException
 
 
- 
 
-