DataSourceMXBean (Apache Tomcat 10.1.2 API Documentation)

Package org.apache.tomcat.dbcp.dbcp2

## Interface DataSourceMXBean

- All Known Subinterfaces:
    `BasicDataSourceMXBean`
  All Known Implementing Classes:
    `BasicDataSource`, `BasicManagedDataSource`

      public interface DataSourceMXBean

  Defines the methods that will be made available via JMX.
  Since:
    2.9.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `getAbandonedUsageTracking()` | See `BasicDataSource.getAbandonedUsageTracking()`.
    `boolean` | `getCacheState()` | See `BasicDataSource.getCacheState()`.
    `String[]` | `getConnectionInitSqlsAsArray()` | See `BasicDataSource.getConnectionInitSqlsAsArray()`.
    `Boolean` | `getDefaultAutoCommit()` | See `BasicDataSource.getDefaultAutoCommit()`.
    `String` | `getDefaultCatalog()` | See `BasicDataSource.getDefaultCatalog()`.
    `Boolean` | `getDefaultReadOnly()` | See `BasicDataSource.getDefaultReadOnly()`.
    `default String` | `getDefaultSchema()` | See `BasicDataSource.getDefaultSchema()`.
    `int` | `getDefaultTransactionIsolation()` | See `BasicDataSource.getDefaultTransactionIsolation()`.
    `String[]` | `getDisconnectionSqlCodesAsArray()` | See `BasicDataSource.getDisconnectionSqlCodesAsArray()`.
    `String` | `getDriverClassName()` | See `BasicDataSource.getDriverClassName()`.
    `boolean` | `getFastFailValidation()` | See `BasicDataSource.getFastFailValidation()`.
    `int` | `getInitialSize()` | See `BasicDataSource.getInitialSize()`.
    `boolean` | `getLifo()` | See `BasicDataSource.getLifo()`.
    `boolean` | `getLogAbandoned()` | See `BasicDataSource.getLogAbandoned()`.
    `boolean` | `getLogExpiredConnections()` | See `BasicDataSource.getLogExpiredConnections()`.
    `long` | `getMaxConnLifetimeMillis()` | See `BasicDataSource.getMaxConnLifetimeMillis()`.
    `int` | `getMaxIdle()` | See `BasicDataSource.getMaxIdle()`.
    `int` | `getMaxOpenPreparedStatements()` | See `BasicDataSource.getMaxOpenPreparedStatements()`.
    `int` | `getMaxTotal()` | See `BasicDataSource.getMaxTotal()`.
    `long` | `getMaxWaitMillis()` | See `BasicDataSource.getMaxWaitMillis()`.
    `long` | `getMinEvictableIdleTimeMillis()` | See `BasicDataSource.getMinEvictableIdleTimeMillis()`.
    `int` | `getMinIdle()` | See `BasicDataSource.getMinIdle()`.
    `int` | `getNumActive()` | See `BasicDataSource.getNumActive()`.
    `int` | `getNumIdle()` | See `BasicDataSource.getNumIdle()`.
    `int` | `getNumTestsPerEvictionRun()` | See `BasicDataSource.getNumTestsPerEvictionRun()`.
    `boolean` | `getRemoveAbandonedOnBorrow()` | See `BasicDataSource.getRemoveAbandonedOnBorrow()`.
    `boolean` | `getRemoveAbandonedOnMaintenance()` | See `BasicDataSource.getRemoveAbandonedOnMaintenance()`.
    `int` | `getRemoveAbandonedTimeout()` | See `BasicDataSource.getRemoveAbandonedTimeout()`.
    `long` | `getSoftMinEvictableIdleTimeMillis()` | See `BasicDataSource.getSoftMinEvictableIdleTimeMillis()`.
    `boolean` | `getTestOnBorrow()` | See `BasicDataSource.getTestOnBorrow()`.
    `boolean` | `getTestOnCreate()` | See `BasicDataSource.getTestOnCreate()`.
    `boolean` | `getTestWhileIdle()` | See `BasicDataSource.getTestWhileIdle()`.
    `long` | `getTimeBetweenEvictionRunsMillis()` | See `BasicDataSource.getTimeBetweenEvictionRunsMillis()`.
    `String` | `getUrl()` | See `BasicDataSource.getUrl()`.
    `String` | `getUsername()` | See `BasicDataSource.getUsername()`.
    `String` | `getValidationQuery()` | See `BasicDataSource.getValidationQuery()`.
    `int` | `getValidationQueryTimeout()` | See `BasicDataSource.getValidationQueryTimeout()`.
    `boolean` | `isAccessToUnderlyingConnectionAllowed()` | See `BasicDataSource.isAccessToUnderlyingConnectionAllowed()`.
    `default boolean` | `isClearStatementPoolOnReturn()` | See `BasicDataSource.isClearStatementPoolOnReturn()`.
    `boolean` | `isClosed()` | See `BasicDataSource.isClosed()`.
    `boolean` | `isPoolPreparedStatements()` | See `BasicDataSource.isPoolPreparedStatements()`.
    `default void` | `restart()` | See `BasicDataSource.restart()`
    `default void` | `start()` | See `BasicDataSource.start()`

- - ### Method Detail

    - #### getAbandonedUsageTracking

          boolean getAbandonedUsageTracking()

      See `BasicDataSource.getAbandonedUsageTracking()`.
      Returns:
        `BasicDataSource.getAbandonedUsageTracking()`

    - #### getCacheState

          boolean getCacheState()

      See `BasicDataSource.getCacheState()`.
      Returns:
        `BasicDataSource.getCacheState()`.

    - #### getConnectionInitSqlsAsArray

          String[] getConnectionInitSqlsAsArray()

      See `BasicDataSource.getConnectionInitSqlsAsArray()`.
      Returns:
        `BasicDataSource.getConnectionInitSqlsAsArray()`.

    - #### getDefaultAutoCommit

          Boolean getDefaultAutoCommit()

      See `BasicDataSource.getDefaultAutoCommit()`.
      Returns:
        `BasicDataSource.getDefaultAutoCommit()`.

    - #### getDefaultCatalog

          String getDefaultCatalog()

      See `BasicDataSource.getDefaultCatalog()`.
      Returns:
        `BasicDataSource.getDefaultCatalog()`.

    - #### getDefaultReadOnly

          Boolean getDefaultReadOnly()

      See `BasicDataSource.getDefaultReadOnly()`.
      Returns:
        `BasicDataSource.getDefaultReadOnly()`.

    - #### getDefaultSchema

          default String getDefaultSchema()

      See `BasicDataSource.getDefaultSchema()`.
      Returns:
        `BasicDataSource.getDefaultSchema()`.
      Since:
        2.5.0

    - #### getDefaultTransactionIsolation

          int getDefaultTransactionIsolation()

      See `BasicDataSource.getDefaultTransactionIsolation()`.
      Returns:
        `BasicDataSource.getDefaultTransactionIsolation()`.

    - #### getDisconnectionSqlCodesAsArray

          String[] getDisconnectionSqlCodesAsArray()

      See `BasicDataSource.getDisconnectionSqlCodesAsArray()`.
      Returns:
        `BasicDataSource.getDisconnectionSqlCodesAsArray()`.
      Since:
        2.1

    - #### getDriverClassName

          String getDriverClassName()

      See `BasicDataSource.getDriverClassName()`.
      Returns:
        `BasicDataSource.getDriverClassName()`.

    - #### getFastFailValidation

          boolean getFastFailValidation()

      See `BasicDataSource.getFastFailValidation()`.
      Returns:
        `BasicDataSource.getFastFailValidation()`.
      Since:
        2.1

    - #### getInitialSize

          int getInitialSize()

      See `BasicDataSource.getInitialSize()`.
      Returns:
        `BasicDataSource.getInitialSize()`.

    - #### getLifo

          boolean getLifo()

      See `BasicDataSource.getLifo()`.
      Returns:
        `BasicDataSource.getLifo()`.

    - #### getLogAbandoned

          boolean getLogAbandoned()

      See `BasicDataSource.getLogAbandoned()`.
      Returns:
        `BasicDataSource.getLogAbandoned()`.

    - #### getLogExpiredConnections

          boolean getLogExpiredConnections()

      See `BasicDataSource.getLogExpiredConnections()`.
      Returns:
        `BasicDataSource.getLogExpiredConnections()`.
      Since:
        2.1

    - #### getMaxConnLifetimeMillis

          long getMaxConnLifetimeMillis()

      See `BasicDataSource.getMaxConnLifetimeMillis()`.
      Returns:
        `BasicDataSource.getMaxConnLifetimeMillis()`.

    - #### getMaxIdle

          int getMaxIdle()

      See `BasicDataSource.getMaxIdle()`.
      Returns:
        `BasicDataSource.getMaxIdle()`.

    - #### getMaxOpenPreparedStatements

          int getMaxOpenPreparedStatements()

      See `BasicDataSource.getMaxOpenPreparedStatements()`.
      Returns:
        `BasicDataSource.getMaxOpenPreparedStatements()`.

    - #### getMaxTotal

          int getMaxTotal()

      See `BasicDataSource.getMaxTotal()`.
      Returns:
        `BasicDataSource.getMaxTotal()`.

    - #### getMaxWaitMillis

          long getMaxWaitMillis()

      See `BasicDataSource.getMaxWaitMillis()`.
      Returns:
        `BasicDataSource.getMaxWaitMillis()`.

    - #### getMinEvictableIdleTimeMillis

          long getMinEvictableIdleTimeMillis()

      See `BasicDataSource.getMinEvictableIdleTimeMillis()`.
      Returns:
        `BasicDataSource.getMinEvictableIdleTimeMillis()`.

    - #### getMinIdle

          int getMinIdle()

      See `BasicDataSource.getMinIdle()`.
      Returns:
        `BasicDataSource.getMinIdle()`.

    - #### getNumActive

          int getNumActive()

      See `BasicDataSource.getNumActive()`.
      Returns:
        `BasicDataSource.getNumActive()`.

    - #### getNumIdle

          int getNumIdle()

      See `BasicDataSource.getNumIdle()`.
      Returns:
        `BasicDataSource.getNumIdle()`.

    - #### getNumTestsPerEvictionRun

          int getNumTestsPerEvictionRun()

      See `BasicDataSource.getNumTestsPerEvictionRun()`.
      Returns:
        `BasicDataSource.getNumTestsPerEvictionRun()`.

    - #### getRemoveAbandonedOnBorrow

          boolean getRemoveAbandonedOnBorrow()

      See `BasicDataSource.getRemoveAbandonedOnBorrow()`.
      Returns:
        `BasicDataSource.getRemoveAbandonedOnBorrow()`.

    - #### getRemoveAbandonedOnMaintenance

          boolean getRemoveAbandonedOnMaintenance()

      See `BasicDataSource.getRemoveAbandonedOnMaintenance()`.
      Returns:
        `BasicDataSource.getRemoveAbandonedOnMaintenance()`.

    - #### getRemoveAbandonedTimeout

          int getRemoveAbandonedTimeout()

      See `BasicDataSource.getRemoveAbandonedTimeout()`.
      Returns:
        `BasicDataSource.getRemoveAbandonedTimeout()`.

    - #### getSoftMinEvictableIdleTimeMillis

          long getSoftMinEvictableIdleTimeMillis()

      See `BasicDataSource.getSoftMinEvictableIdleTimeMillis()`.
      Returns:
        `BasicDataSource.getSoftMinEvictableIdleTimeMillis()`.

    - #### getTestOnBorrow

          boolean getTestOnBorrow()

      See `BasicDataSource.getTestOnBorrow()`.
      Returns:
        `BasicDataSource.getTestOnBorrow()`.

    - #### getTestOnCreate

          boolean getTestOnCreate()

      See `BasicDataSource.getTestOnCreate()`.
      Returns:
        `BasicDataSource.getTestOnCreate()`.

    - #### getTestWhileIdle

          boolean getTestWhileIdle()

      See `BasicDataSource.getTestWhileIdle()`.
      Returns:
        `BasicDataSource.getTestWhileIdle()`.

    - #### getTimeBetweenEvictionRunsMillis

          long getTimeBetweenEvictionRunsMillis()

      See `BasicDataSource.getTimeBetweenEvictionRunsMillis()`.
      Returns:
        `BasicDataSource.getTimeBetweenEvictionRunsMillis()`.

    - #### getUrl

          String getUrl()

      See `BasicDataSource.getUrl()`.
      Returns:
        `BasicDataSource.getUrl()`.

    - #### getUsername

          String getUsername()

      See `BasicDataSource.getUsername()`.
      Returns:
        `BasicDataSource.getUsername()`.

    - #### getValidationQuery

          String getValidationQuery()

      See `BasicDataSource.getValidationQuery()`.
      Returns:
        `BasicDataSource.getValidationQuery()`.

    - #### getValidationQueryTimeout

          int getValidationQueryTimeout()

      See `BasicDataSource.getValidationQueryTimeout()`.
      Returns:
        `BasicDataSource.getValidationQueryTimeout()`.

    - #### isAccessToUnderlyingConnectionAllowed

          boolean isAccessToUnderlyingConnectionAllowed()

      See `BasicDataSource.isAccessToUnderlyingConnectionAllowed()`.
      Returns:
        `BasicDataSource.isAccessToUnderlyingConnectionAllowed()`.

    - #### isClearStatementPoolOnReturn

          default boolean isClearStatementPoolOnReturn()

      See `BasicDataSource.isClearStatementPoolOnReturn()`.
      Returns:
        `BasicDataSource.isClearStatementPoolOnReturn()`.
      Since:
        2.8.0

    - #### isClosed

          boolean isClosed()

      See `BasicDataSource.isClosed()`.
      Returns:
        `BasicDataSource.isClosed()`.

    - #### isPoolPreparedStatements

          boolean isPoolPreparedStatements()

      See `BasicDataSource.isPoolPreparedStatements()`.
      Returns:
        `BasicDataSource.isPoolPreparedStatements()`.

    - #### restart

          default void restart()
                        throws SQLException

      See `BasicDataSource.restart()`
      Throws:
        `SQLException` - if an error occurs initializing the data source.
      Since:
        2.8.0

    - #### start

          default void start()
                      throws SQLException

      See `BasicDataSource.start()`
      Throws:
        `SQLException` - if an error occurs initializing the data source.
      Since:
        2.8.0