类 DatasourceConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl
-
- 所有已实现的接口:
Serializable,ConnectionProvider,Service,Configurable,Stoppable,Wrapped
public class DatasourceConnectionProviderImpl extends Object implements ConnectionProvider, Configurable, Stoppable
AConnectionProviderthat manages connections from an underlyingDataSource. TheDataSourceto use may be specified by either:- injection via
setDataSource(javax.sql.DataSource) - declaring the
DataSourceinstance using theAvailableSettings.DATASOURCEconfig property - declaring the JNDI name under which the
DataSourcecan be found viaAvailableSettings.DATASOURCEconfig property
- 作者:
- Gavin King, Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 DatasourceConnectionProviderImpl()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcloseConnection(Connection connection)Release a connection from Hibernate use.voidconfigure(Map configValues)Configure the service.ConnectiongetConnection()Obtains a connection for Hibernate use according to the underlying strategy of this provider.DataSourcegetDataSource()booleanisUnwrappableAs(Class unwrapType)Can this wrapped service be unwrapped as the indicated type?voidsetDataSource(DataSource dataSource)voidsetJndiService(JndiService jndiService)voidstop()Stop phase notificationbooleansupportsAggressiveRelease()Does this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later?<T> Tunwrap(Class<T> unwrapType)Unproxy the service proxy
-
-
-
方法详细资料
-
getDataSource
public DataSource getDataSource()
-
setDataSource
public void setDataSource(DataSource dataSource)
-
setJndiService
public void setJndiService(JndiService jndiService)
-
isUnwrappableAs
public boolean isUnwrappableAs(Class unwrapType)
从接口复制的说明:WrappedCan this wrapped service be unwrapped as the indicated type?- 指定者:
isUnwrappableAs在接口中Wrapped- 参数:
unwrapType- The type to check.- 返回:
- True/false.
-
configure
public void configure(Map configValues)
从接口复制的说明:ConfigurableConfigure the service.- 指定者:
configure在接口中Configurable- 参数:
configValues- The configuration properties.
-
getConnection
public Connection getConnection() throws SQLException
从接口复制的说明:ConnectionProviderObtains a connection for Hibernate use according to the underlying strategy of this provider.- 指定者:
getConnection在接口中ConnectionProvider- 返回:
- The obtained JDBC connection
- 抛出:
SQLException- Indicates a problem opening a connection
-
closeConnection
public void closeConnection(Connection connection) throws SQLException
从接口复制的说明:ConnectionProviderRelease a connection from Hibernate use.- 指定者:
closeConnection在接口中ConnectionProvider- 参数:
connection- The JDBC connection to release- 抛出:
SQLException- Indicates a problem closing the connection
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
从接口复制的说明:ConnectionProviderDoes this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later? This is used in conjunction withAvailableSettings.RELEASE_CONNECTIONSto aggressively release JDBC connections. However, the configured ConnectionProvider must support re-acquisition of the same underlying connection for that semantic to work. Typically, this is only true in managed environments where a container tracks connections by transaction or thread. Note that JTA semantic depends on the fact that the underlying connection provider does support aggressive release.- 指定者:
supportsAggressiveRelease在接口中ConnectionProvider- 返回:
trueif aggressive releasing is supported;falseotherwise.
-
-