@Internal
public class DataSourceWrapper
extends java.lang.Object
implements java.lang.AutoCloseable, io.spine.logging.Logging
DataSource
instances.Modifier | Constructor and Description |
---|---|
protected |
DataSourceWrapper(javax.sql.DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes wrapped
DataSource implementation if it implements AutoCloseable . |
ConnectionWrapper |
getConnection(boolean autoCommit)
Retrieves a wrapped connection with the given auto commit mode.
|
public ConnectionWrapper getConnection(boolean autoCommit) throws DatabaseException
DatabaseException
- if an error occurs during an interaction with the DBConnection.setAutoCommit(boolean)
public void close() throws DatabaseException
DataSource
implementation if it implements AutoCloseable
.
Otherwise a warning is logged.
close
in interface java.lang.AutoCloseable
DatabaseException
- if the DataSource
throws an exception