类 DriverManagerConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
-
- 所有已实现的接口:
Serializable,ConnectionProvider,Service,Configurable,ServiceRegistryAwareService,Stoppable,Wrapped
public class DriverManagerConnectionProviderImpl extends Object implements ConnectionProvider, Configurable, Stoppable, ServiceRegistryAwareService
A connection provider that uses theDriverManagerdirectly to open connections and provides a very rudimentary connection pool. IMPL NOTE : not intended for production use! Thanks to Oleg Varaksin and his article on object pooling using thejava.util.concurrentpackage, from which much of the pooling code here is derived. See http://ovaraksin.blogspot.com/2013/08/simple-and-lightweight-pool.html- 作者:
- Gavin King, Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classDriverManagerConnectionProviderImpl.PooledConnections
-
字段概要
字段 修饰符和类型 字段 说明 static StringINITIAL_SIZEstatic StringMIN_SIZEstatic StringVALIDATION_INTERVAL
-
构造器概要
构造器 构造器 说明 DriverManagerConnectionProviderImpl()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcloseConnection(Connection conn)Release a connection from Hibernate use.voidconfigure(Map configurationValues)Configure the service.protected voidfinalize()ConnectiongetConnection()Obtains a connection for Hibernate use according to the underlying strategy of this provider.PropertiesgetConnectionProperties()Exposed to facilitate testing only.voidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.booleanisUnwrappableAs(Class unwrapType)Can this wrapped service be unwrapped as the indicated type?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
-
-
-
方法详细资料
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
从接口复制的说明:ServiceRegistryAwareServiceCallback to inject the registry.- 指定者:
injectServices在接口中ServiceRegistryAwareService- 参数:
serviceRegistry- The registry
-
configure
public void configure(Map configurationValues)
从接口复制的说明:ConfigurableConfigure the service.- 指定者:
configure在接口中Configurable- 参数:
configurationValues- 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 conn) throws SQLException
从接口复制的说明:ConnectionProviderRelease a connection from Hibernate use.- 指定者:
closeConnection在接口中ConnectionProvider- 参数:
conn- 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.
-
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.
-
getConnectionProperties
public Properties getConnectionProperties()
Exposed to facilitate testing only.- 返回:
-
-