public class DefaultSpringJdbcConnectionHandler extends Object implements SpringJdbcConnectionHandler
SpringJdbcConnectionHandler, which uses DataSourceUtils to obtain and release a
Spring-managed transactional connection.JdbcConnectionHandler.ConnectionType| Constructor and Description |
|---|
DefaultSpringJdbcConnectionHandler() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection(DataSource dataSource,
JdbcConnectionHandler.ConnectionType connectionType)
Get a
Connection using given DataSource. |
void |
releaseConnection(Connection connection,
DataSource dataSource,
JdbcConnectionHandler.ConnectionType connectionType)
Release given
connection, performing any connection finalization operation (for example to close the
connection). |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic Connection getConnection(DataSource dataSource, JdbcConnectionHandler.ConnectionType connectionType) throws SQLException
JdbcConnectionHandlerConnection using given DataSource.getConnection in interface JdbcConnectionHandlerdataSource - The DataSource from which to obtain connectionsconnectionType - Connection type to discern if the connection will be used for initialization or for normal
JDBC operationsnullSQLException - If an error occurred and the connection cannot be providedpublic void releaseConnection(Connection connection, DataSource dataSource, JdbcConnectionHandler.ConnectionType connectionType) throws SQLException
JdbcConnectionHandlerconnection, performing any connection finalization operation (for example to close the
connection).releaseConnection in interface JdbcConnectionHandlerconnection - The connection to releasedataSource - The DataSource from which the connection was obtainedconnectionType - Connection type to discern if the connection was used for initialization or for normal JDBC
operationsSQLException - If an error occurred and the connection cannot be releasedCopyright © 2019 The Holon Platform. All rights reserved.