接口 DataSourcePoolMetadata
- 所有已知实现类:
AbstractDataSourcePoolMetadata
,CommonsDbcp2DataSourcePoolMetadata
,HikariDataSourcePoolMetadata
,TomcatDataSourcePoolMetadata
public interface DataSourcePoolMetadata
Provides access meta-data that is commonly available from most pooledDataSource
implementations.- 从以下版本开始:
- 2.0.0
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Integer
getActive()
Return the current number of active connections that have been allocated from the data source ornull
if that information is not available.Boolean
getDefaultAutoCommit()
The default auto-commit state of connections created by this pool.Integer
getMax()
Return the maximum number of active connections that can be allocated at the same time or-1
if there is no limit.Integer
getMin()
Return the minimum number of idle connections in the pool ornull
if that information is not available.Float
getUsage()
Return the usage of the pool as value between 0 and 1 (or -1 if the pool is not limited).String
getValidationQuery()
Return the query to use to validate that a connection is valid ornull
if that information is not available.
方法详细资料
getUsage
Float getUsage()
Return the usage of the pool as value between 0 and 1 (or -1 if the pool is not limited).- 1 means that the maximum number of connections have been allocated
- 0 means that no connection is currently active
- -1 means there is not limit to the number of connections that can be allocated
null
if the data source does not provide the necessary information to compute the poll usage.- 返回:
- the usage value or
null
getActive
Integer getActive()
Return the current number of active connections that have been allocated from the data source ornull
if that information is not available.- 返回:
- the number of active connections or
null
getMax
Integer getMax()
Return the maximum number of active connections that can be allocated at the same time or-1
if there is no limit. Can also returnnull
if that information is not available.- 返回:
- the maximum number of active connections or
null
getMin
Integer getMin()
Return the minimum number of idle connections in the pool ornull
if that information is not available.- 返回:
- the minimum number of active connections or
null
getValidationQuery
String getValidationQuery()
Return the query to use to validate that a connection is valid ornull
if that information is not available.- 返回:
- the validation query or
null
getDefaultAutoCommit
Boolean getDefaultAutoCommit()
The default auto-commit state of connections created by this pool. If not set (null
), default is JDBC driver default (If set to null then the java.sql.Connection.setAutoCommit(boolean) method will not be called.)- 返回:
- the default auto-commit state or
null