java.lang.Object
org.jooq.impl.DefaultConnectionProvider
- All Implemented Interfaces:
- ConnectionProvider
A default implementation for 
ConnectionProvider.
 
 This implementation just wraps a JDBC Connection and provides jOOQ
 with the same connection for every query. jOOQ will not call any
 transaction-related methods on the supplied connection. Instead, jOOQ
 provides you with convenient access to those methods, wrapping any checked
 SQLException into an unchecked DataAccessException
- Author:
- Aaron Digulla, Lukas Eder
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription@NotNull Connectionacquire()Acquire a connection from the connection lifecycle handler.voidcommit()Convenience method to accessConnection.commit().booleanConvenience method to accessConnection.getAutoCommit().intConvenience method to accessConnection.getHoldability().intConvenience method to accessConnection.getTransactionIsolation().booleanConvenience method to accessConnection.isReadOnly().voidrelease(Connection released)Release a connection to the connection lifecycle handler.voidreleaseSavepoint(Savepoint savepoint)Convenience method to accessConnection.releaseSavepoint(Savepoint).voidrollback()Convenience method to accessConnection.rollback().voidConvenience method to accessConnection.rollback(Savepoint).voidsetAutoCommit(boolean autoCommit)Convenience method to accessConnection.setAutoCommit(boolean).voidsetConnection(Connection connection)voidsetHoldability(int holdability)Convenience method to accessConnection.setHoldability(int).voidsetReadOnly(boolean readOnly)Convenience method to accessConnection.setReadOnly(boolean).@NotNull SavepointConvenience method to accessConnection.setSavepoint().@NotNull SavepointsetSavepoint(String name)Convenience method to accessConnection.setSavepoint(String).voidsetTransactionIsolation(int level)Convenience method to accessConnection.setTransactionIsolation(int).
- 
Constructor Details- 
DefaultConnectionProvider
 
- 
- 
Method Details- 
acquireDescription copied from interface:ConnectionProviderAcquire a connection from the connection lifecycle handler.This method is called by jOOQ exactly once per execution lifecycle, i.e. per ExecuteContext. Implementations may freely chose, whether subsequent calls to this method:- return the same connection instance
- return the same connection instance for the same thread
- return the same connection instance for the same transaction (e.g. a
 javax.transaction.UserTransaction)
- return a fresh connection instance every time
 jOOQ will guarantee that every acquired connection is released through ConnectionProvider.release(Connection)exactly once.- Specified by:
- acquirein interface- ConnectionProvider
- Returns:
- A connection for the current ExecuteContext. Ifnullis returned (e.g. by NoConnectionProvider), then statements cannot be executed. Attempts to execute statements will result in aDetachedException.
 
- 
releaseDescription copied from interface:ConnectionProviderRelease a connection to the connection lifecycle handler.jOOQ will guarantee that every acquired connection is released exactly once. - Specified by:
- releasein interface- ConnectionProvider
- Parameters:
- released- A connection that was previously obtained from- ConnectionProvider.acquire(). This is never- null.
 
- 
setConnection
- 
commitConvenience method to accessConnection.commit().- Throws:
- DataAccessException
 
- 
rollbackConvenience method to accessConnection.rollback().- Throws:
- DataAccessException
 
- 
rollbackConvenience method to accessConnection.rollback(Savepoint).- Throws:
- DataAccessException
 
- 
setSavepointConvenience method to accessConnection.setSavepoint().- Throws:
- DataAccessException
 
- 
setSavepointConvenience method to accessConnection.setSavepoint(String).- Throws:
- DataAccessException
 
- 
releaseSavepointConvenience method to accessConnection.releaseSavepoint(Savepoint).- Throws:
- DataAccessException
 
- 
setReadOnlyConvenience method to accessConnection.setReadOnly(boolean).- Throws:
- DataAccessException
 
- 
isReadOnlyConvenience method to accessConnection.isReadOnly().- Throws:
- DataAccessException
 
- 
setAutoCommitConvenience method to accessConnection.setAutoCommit(boolean).- Throws:
- DataAccessException
 
- 
getAutoCommitConvenience method to accessConnection.getAutoCommit().- Throws:
- DataAccessException
 
- 
setHoldabilityConvenience method to accessConnection.setHoldability(int).- Throws:
- DataAccessException
 
- 
getHoldabilityConvenience method to accessConnection.getHoldability().- Throws:
- DataAccessException
 
- 
setTransactionIsolationConvenience method to accessConnection.setTransactionIsolation(int).- Throws:
- DataAccessException
 
- 
getTransactionIsolationConvenience method to accessConnection.getTransactionIsolation().- Throws:
- DataAccessException
 
 
-