Class CommonsDbcp2DataSourcePoolMetadata
java.lang.Object
org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata<org.apache.commons.dbcp2.BasicDataSource>
org.springframework.boot.jdbc.metadata.CommonsDbcp2DataSourcePoolMetadata
- All Implemented Interfaces:
DataSourcePoolMetadata
public class CommonsDbcp2DataSourcePoolMetadata
extends AbstractDataSourcePoolMetadata<org.apache.commons.dbcp2.BasicDataSource>
DataSourcePoolMetadata for an Apache Commons DBCP2 DataSource.- Since:
- 2.0.0
- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionCommonsDbcp2DataSourcePoolMetadata(org.apache.commons.dbcp2.BasicDataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptionReturn the current number of active connections that have been allocated from the data source ornullif that information is not available.The default auto-commit state of connections created by this pool.getIdle()Return the number of established but idle connections.getMax()Return the maximum number of active connections that can be allocated at the same time or-1if there is no limit.getMin()Return the minimum number of idle connections in the pool ornullif that information is not available.Return the query to use to validate that a connection is valid ornullif that information is not available.Methods inherited from class org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata
getDataSource, getUsage
-
Constructor Details
-
CommonsDbcp2DataSourcePoolMetadata
public CommonsDbcp2DataSourcePoolMetadata(org.apache.commons.dbcp2.BasicDataSource dataSource)
-
-
Method Details
-
getActive
Description copied from interface:DataSourcePoolMetadataReturn the current number of active connections that have been allocated from the data source ornullif that information is not available.- Returns:
- the number of active connections or
null
-
getIdle
Description copied from interface:DataSourcePoolMetadataReturn the number of established but idle connections. Can also returnnullif that information is not available.- Returns:
- the number of established but idle connections or
null - See Also:
-
getMax
Description copied from interface:DataSourcePoolMetadataReturn the maximum number of active connections that can be allocated at the same time or-1if there is no limit. Can also returnnullif that information is not available.- Returns:
- the maximum number of active connections or
null
-
getMin
Description copied from interface:DataSourcePoolMetadataReturn the minimum number of idle connections in the pool ornullif that information is not available.- Returns:
- the minimum number of active connections or
null
-
getValidationQuery
Description copied from interface:DataSourcePoolMetadataReturn the query to use to validate that a connection is valid ornullif that information is not available.- Returns:
- the validation query or
null
-
getDefaultAutoCommit
Description copied from interface:DataSourcePoolMetadataThe 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.)- Returns:
- the default auto-commit state or
null
-