public class ConnectionHelper extends Object
Connection from a datasource name.| Constructor and Description |
|---|
ConnectionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Connection |
getConnection(String dataSourceName)
Gets a new connection for the given dataSource.
|
static Connection |
getConnection(String dataSourceName,
boolean noSharing)
Gets a new connection for the given dataSource.
|
static Connection |
unwrap(Connection connection)
Tries to unwrap the connection to get the real physical one (returned by the original datasource).
|
public ConnectionHelper()
public static Connection unwrap(Connection connection) throws SQLException
This should only be used by code that needs to cast the connection to a driver-specific class to use driver-specific features.
SQLException - if no actual physical connection was allocated yetpublic static Connection getConnection(String dataSourceName) throws SQLException
dataSourceName - the datasource for which the connection is requestedSQLExceptionpublic static Connection getConnection(String dataSourceName, boolean noSharing) throws SQLException
dataSourceName - the datasource for which the connection is requestednoSharing - true if this connection must not be shared with othersSQLExceptionCopyright © 2018 Nuxeo. All rights reserved.