use of org.dbflute.jdbc.ManualThreadDataSourceHandler in project dbflute-core by dbflute.
the class TnAbstractBasicSqlHandler method getConnection.
// ===================================================================================
// JDBC Handling
// =============
// -----------------------------------------------------
// Connection
// ----------
/**
* Get the database connection from data source. <br>
* getting connection for SQL executions is only here. <br>
* (for meta data is at TnBeanMetaDataFactoryImpl)
* @return The new-created or inherited instance of connection. (NotNull)
*/
protected Connection getConnection() {
try {
final ManualThreadDataSourceHandler handler = getManualThreadDataSourceHandler();
if (handler != null) {
return handler.getConnection(_dataSource);
}
final Connection conn = _dataSource.getConnection();
return conn;
} catch (SQLException e) {
final SQLExceptionResource resource = createSQLExceptionResource();
resource.setNotice("Failed to get database connection.");
handleSQLException(e, resource);
// unreachable
return null;
}
}
Aggregations