DataSource-oriented
ConnectionProvider
This implementation wraps a JDBC DataSource. jOOQ will use that data
source for initialising connections, and creating statements.
Use this connection provider if you want to run distributed transactions,
such as javax.transaction.UserTransaction. jOOQ will
close() all connections after query execution (and
result fetching) in order to return the connection to the connection pool. If
you do not use distributed transactions, this will produce driver-specific
behaviour at the end of query execution at close() invocation
(e.g. a transaction rollback). Use a DefaultConnectionProvider
instead, to control the connection's lifecycle, or implement your own
ConnectionProvider.
| Modifier and Type | Field and Description |
|---|---|
| private final DataSource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public @NotNull Connection | acquire()
Implements org. |
| public @NotNull DataSource | |
| public void | release(Connection
A connection that was previously obtained from
connection)acquire(). This is never null.Implements org. |
| dataSource | back to summary |
|---|---|
| private final DataSource dataSource | |
| DataSourceConnectionProvider | back to summary |
|---|---|
| public DataSourceConnectionProvider(DataSource dataSource) | |
| acquire | back to summary |
|---|---|
| public @NotNull Connection acquire() Implements org. Doc from org. Acquire a connection from the connection lifecycle handler.
This method is called by jOOQ exactly once per execution lifecycle, i.e.
per
jOOQ will guarantee that every acquired connection is released through
| |
| dataSource | back to summary |
|---|---|
public @NotNull DataSource dataSource()
| |
| release | back to summary |
|---|---|
| public void release(Connection connection) Implements org. Doc from org. Release a connection to the connection lifecycle handler. jOOQ will guarantee that every acquired connection is released exactly once.
| |