PerUserPoolDataSource (Apache Tomcat 9.0.117 API Documentation)
Description: declaration: package: org.apache.tomcat.dbcp.dbcp2.datasources, class: PerUserPoolDataSource

# Class PerUserPoolDataSource

java.lang.Object
org.apache.tomcat.dbcp.dbcp2.datasources.InstanceKeyDataSource
org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource

All Implemented Interfaces:
  `Serializable, AutoCloseable, Wrapper, Referenceable, CommonDataSource, DataSource`

public class PerUserPoolDataSource extends InstanceKeyDataSource

A pooling `DataSource` appropriate for deployment within J2EE environment. There are many configuration options, most of which are defined in the parent class. This datasource uses individual pools per user, and some properties can be set specifically for a given user, if the deployment environment can support initialization of mapped properties. So for example, a pool of admin or write-access Connections can be guaranteed a certain number of connections, separate from a maximum set for users with read-only connections.

User passwords can be changed without re-initializing the datasource. When a `getConnection(userName, password)` request is processed with a password that is different from those used to create connections in the pool associated with `userName`, an attempt is made to create a new connection using the supplied password and if this succeeds, the existing pool is cleared and a new pool is created for connections using the new password.

Since:
  2.0
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class InstanceKeyDataSource

  `UNKNOWN_TRANSACTIONISOLATION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PerUserPoolDataSource()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Clears pool(s) maintained by this data source.
  `void`
  `close()`
  Closes pool(s) maintained by this data source.
  `protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionManager`
  `getConnectionManager(org.apache.tomcat.dbcp.dbcp2.datasources.UserPassKey upKey)`
  Gets the pooled connection manager for the given key.
  `int`
  `getNumActive()`
  Gets the number of active connections in the default pool.
  `int`
  `getNumActive(String userName)`
  Gets the number of active connections in the pool for a given user.
  `int`
  `getNumIdle()`
  Gets the number of idle connections in the default pool.
  `int`
  `getNumIdle(String userName)`
  Gets the number of idle connections in the pool for a given user.
  `boolean`
  `getPerUserBlockWhenExhausted(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getBlockWhenExhausted()` for the specified user's pool or the default if no user specific value is defined.
  `Boolean`
  `getPerUserDefaultAutoCommit(String userName)`
  Gets the user specific default value for `Connection.setAutoCommit(boolean)` for the specified user's pool.
  `Boolean`
  `getPerUserDefaultReadOnly(String userName)`
  Gets the user specific default value for `Connection.setReadOnly(boolean)` for the specified user's pool.
  `Integer`
  `getPerUserDefaultTransactionIsolation(String userName)`
  Gets the user specific default value for `Connection.setTransactionIsolation(int)` for the specified user's pool.
  `Duration`
  `getPerUserDurationBetweenEvictionRuns(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool or the default if no user specific value is defined.
  `String`
  `getPerUserEvictionPolicyClassName(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getEvictionPolicyClassName()` for the specified user's pool or the default if no user specific value is defined.
  `boolean`
  `getPerUserLifo(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getLifo()` for the specified user's pool or the default if no user specific value is defined.
  `int`
  `getPerUserMaxIdle(String userName)`
  Gets the user specific value for `GenericObjectPool.getMaxIdle()` for the specified user's pool or the default if no user specific value is defined.
  `int`
  `getPerUserMaxTotal(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getMaxTotal()` for the specified user's pool or the default if no user specific value is defined.
  `Duration`
  `getPerUserMaxWaitDuration(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool or the default if no user specific value is defined.
  `long`
  `getPerUserMaxWaitMillis(String userName)`
  Deprecated.
  Use `getPerUserMaxWaitDuration(String)`.
  `Duration`
  `getPerUserMinEvictableIdleDuration(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
  `long`
  `getPerUserMinEvictableIdleTimeMillis(String userName)`
  Deprecated.
  Use `getPerUserMinEvictableIdleDuration(String)`.
  `int`
  `getPerUserMinIdle(String userName)`
  Gets the user specific value for `GenericObjectPool.getMinIdle()` for the specified user's pool or the default if no user specific value is defined.
  `int`
  `getPerUserNumTestsPerEvictionRun(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getNumTestsPerEvictionRun()` for the specified user's pool or the default if no user specific value is defined.
  `Duration`
  `getPerUserSoftMinEvictableIdleDuration(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
  `long`
  `getPerUserSoftMinEvictableIdleTimeMillis(String userName)`
  Deprecated.
  Use `getPerUserSoftMinEvictableIdleDuration(String)`.
  `boolean`
  `getPerUserTestOnBorrow(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getTestOnBorrow()` for the specified user's pool or the default if no user specific value is defined.
  `boolean`
  `getPerUserTestOnCreate(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getTestOnCreate()` for the specified user's pool or the default if no user specific value is defined.
  `boolean`
  `getPerUserTestOnReturn(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getTestOnReturn()` for the specified user's pool or the default if no user specific value is defined.
  `boolean`
  `getPerUserTestWhileIdle(String userName)`
  Gets the user specific value for `BaseGenericObjectPool.getTestWhileIdle()` for the specified user's pool or the default if no user specific value is defined.
  `long`
  `getPerUserTimeBetweenEvictionRunsMillis(String userName)`
  Deprecated.
  Use `getPerUserDurationBetweenEvictionRuns(String)`.
  `protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionAndInfo`
  `getPooledConnectionAndInfo(String userName, String password)`
  This method is protected but can only be implemented in this package because PooledConnectionAndInfo is a package private type.
  `Reference`
  `getReference()`
  Returns a `PerUserPoolDataSource` `Reference`.
  `void`
  `setPerUserBlockWhenExhausted(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getBlockWhenExhausted()` for the specified user's pool.
  `void`
  `setPerUserDefaultAutoCommit(String userName, Boolean value)`
  Sets a user specific default value for `Connection.setAutoCommit(boolean)` for the specified user's pool.
  `void`
  `setPerUserDefaultReadOnly(String userName, Boolean value)`
  Sets a user specific default value for `Connection.setReadOnly(boolean)` for the specified user's pool.
  `void`
  `setPerUserDefaultTransactionIsolation(String userName, Integer value)`
  Sets a user specific default value for `Connection.setTransactionIsolation(int)` for the specified user's pool.
  `void`
  `setPerUserDurationBetweenEvictionRuns(String userName, Duration value)`
  Sets a user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool.
  `void`
  `setPerUserEvictionPolicyClassName(String userName, String value)`
  Sets a user specific value for `BaseGenericObjectPool.getEvictionPolicyClassName()` for the specified user's pool.
  `void`
  `setPerUserLifo(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getLifo()` for the specified user's pool.
  `void`
  `setPerUserMaxIdle(String userName, Integer value)`
  Sets a user specific value for `GenericObjectPool.getMaxIdle()` for the specified user's pool.
  `void`
  `setPerUserMaxTotal(String userName, Integer value)`
  Sets a user specific value for `BaseGenericObjectPool.getMaxTotal()` for the specified user's pool.
  `void`
  `setPerUserMaxWait(String userName, Duration value)`
  Sets a user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool.
  `void`
  `setPerUserMaxWaitMillis(String userName, Long value)`
  Deprecated.
  Use `setPerUserMaxWait(String, Duration)`.
  `void`
  `setPerUserMinEvictableIdle(String userName, Duration value)`
  Sets a user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool.
  `void`
  `setPerUserMinEvictableIdleTimeMillis(String userName, Long value)`
  Deprecated.
  Use `setPerUserMinEvictableIdle(String, Duration)`.
  `void`
  `setPerUserMinIdle(String userName, Integer value)`
  Sets a user specific value for `GenericObjectPool.getMinIdle()` for the specified user's pool.
  `void`
  `setPerUserNumTestsPerEvictionRun(String userName, Integer value)`
  Sets a user specific value for `BaseGenericObjectPool.getNumTestsPerEvictionRun()` for the specified user's pool.
  `void`
  `setPerUserSoftMinEvictableIdle(String userName, Duration value)`
  Sets a user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool.
  `void`
  `setPerUserSoftMinEvictableIdleTimeMillis(String userName, Long value)`
  Deprecated.
  Use `setPerUserSoftMinEvictableIdle(String, Duration)`.
  `void`
  `setPerUserTestOnBorrow(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getTestOnBorrow()` for the specified user's pool.
  `void`
  `setPerUserTestOnCreate(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getTestOnCreate()` for the specified user's pool.
  `void`
  `setPerUserTestOnReturn(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getTestOnReturn()` for the specified user's pool.
  `void`
  `setPerUserTestWhileIdle(String userName, Boolean value)`
  Sets a user specific value for `BaseGenericObjectPool.getTestWhileIdle()` for the specified user's pool.
  `void`
  `setPerUserTimeBetweenEvictionRunsMillis(String userName, Long value)`
  Deprecated.
  Use `setPerUserDurationBetweenEvictionRuns(String, Duration)`.
  `protected void`
  `setupDefaults(Connection con, String userName)`
  Sets up the defaults for a given connection.

  ### Methods inherited from class InstanceKeyDataSource

  `assertInitializationAllowed, getConnection, getConnection, getConnectionPoolDataSource, getDataSourceName, getDefaultBlockWhenExhausted, getDefaultDurationBetweenEvictionRuns, getDefaultEvictionPolicyClassName, getDefaultLifo, getDefaultMaxIdle, getDefaultMaxTotal, getDefaultMaxWait, getDefaultMaxWaitMillis, getDefaultMinEvictableIdleDuration, getDefaultMinEvictableIdleTimeMillis, getDefaultMinIdle, getDefaultNumTestsPerEvictionRun, getDefaultSoftMinEvictableIdleDuration, getDefaultSoftMinEvictableIdleTimeMillis, getDefaultTestOnBorrow, getDefaultTestOnCreate, getDefaultTestOnReturn, getDefaultTestWhileIdle, getDefaultTimeBetweenEvictionRunsMillis, getDefaultTransactionIsolation, getDescription, getInstanceKey, getJndiEnvironment, getLoginTimeout, getLoginTimeoutDuration, getLogWriter, getMaxConnDuration, getMaxConnLifetime, getMaxConnLifetimeMillis, getParentLogger, getValidationQuery, getValidationQueryTimeout, getValidationQueryTimeoutDuration, isDefaultAutoCommit, isDefaultReadOnly, isRollbackAfterValidation, isWrapperFor, setConnectionPoolDataSource, setDataSourceName, setDefaultAutoCommit, setDefaultBlockWhenExhausted, setDefaultDurationBetweenEvictionRuns, setDefaultEvictionPolicyClassName, setDefaultLifo, setDefaultMaxIdle, setDefaultMaxTotal, setDefaultMaxWait, setDefaultMaxWaitMillis, setDefaultMinEvictableIdle, setDefaultMinEvictableIdleTimeMillis, setDefaultMinIdle, setDefaultNumTestsPerEvictionRun, setDefaultReadOnly, setDefaultSoftMinEvictableIdle, setDefaultSoftMinEvictableIdleTimeMillis, setDefaultTestOnBorrow, setDefaultTestOnCreate, setDefaultTestOnReturn, setDefaultTestWhileIdle, setDefaultTimeBetweenEvictionRunsMillis, setDefaultTransactionIsolation, setDescription, setJndiEnvironment, setLoginTimeout, setLoginTimeout, setLogWriter, setMaxConnLifetime, setMaxConnLifetimeMillis, setRollbackAfterValidation, setValidationQuery, setValidationQueryTimeout, setValidationQueryTimeout, testCPDS, toString, toStringFields, unwrap`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface CommonDataSource

  `createShardingKeyBuilder`

  ### Methods inherited from interface DataSource

  `createConnectionBuilder`

- ## Constructor Details

  - ### PerUserPoolDataSource

    public PerUserPoolDataSource()
    Constructs a new instance.

- ## Method Details

  - ### clear

    public void clear()
    Clears pool(s) maintained by this data source.
    Since:
      2.3.0
    See Also:
      - `ObjectPool.clear()`

  - ### close

    public void close()
    Closes pool(s) maintained by this data source.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in class `InstanceKeyDataSource`
    See Also:
      - `ObjectPool.close()`

  - ### getConnectionManager

    protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionManager getConnectionManager(org.apache.tomcat.dbcp.dbcp2.datasources.UserPassKey upKey)
    Description copied from class: `InstanceKeyDataSource`
    Gets the pooled connection manager for the given key.
    Specified by:
      `getConnectionManager` in class `InstanceKeyDataSource`
    Parameters:
      `upKey` - the key.
    Returns:
      the pooled connection manager for the given key.

  - ### getNumActive

    public int getNumActive()
    Gets the number of active connections in the default pool.
    Returns:
      The number of active connections in the default pool.

  - ### getNumActive

    public int getNumActive(String userName)
    Gets the number of active connections in the pool for a given user.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getNumIdle

    public int getNumIdle()
    Gets the number of idle connections in the default pool.
    Returns:
      The number of idle connections in the default pool.

  - ### getNumIdle

    public int getNumIdle(String userName)
    Gets the number of idle connections in the pool for a given user.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserBlockWhenExhausted

    public boolean getPerUserBlockWhenExhausted(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getBlockWhenExhausted()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserDefaultAutoCommit

    public Boolean getPerUserDefaultAutoCommit(String userName)
    Gets the user specific default value for `Connection.setAutoCommit(boolean)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserDefaultReadOnly

    public Boolean getPerUserDefaultReadOnly(String userName)
    Gets the user specific default value for `Connection.setReadOnly(boolean)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserDefaultTransactionIsolation

    public Integer getPerUserDefaultTransactionIsolation(String userName)
    Gets the user specific default value for `Connection.setTransactionIsolation(int)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserDurationBetweenEvictionRuns

    public Duration getPerUserDurationBetweenEvictionRuns(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.
    Since:
      2.10.0

  - ### getPerUserEvictionPolicyClassName

    public String getPerUserEvictionPolicyClassName(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getEvictionPolicyClassName()` for the specified user's pool or the default if no user specific value is defined.

    The class must implement `EvictionPolicy`.

    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserLifo

    public boolean getPerUserLifo(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getLifo()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserMaxIdle

    public int getPerUserMaxIdle(String userName)
    Gets the user specific value for `GenericObjectPool.getMaxIdle()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserMaxTotal

    public int getPerUserMaxTotal(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getMaxTotal()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserMaxWaitDuration

    public Duration getPerUserMaxWaitDuration(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.
    Since:
      2.10.0

  - ### getPerUserMaxWaitMillis

    @Deprecated public long getPerUserMaxWaitMillis(String userName)
    Deprecated.
    Use `getPerUserMaxWaitDuration(String)`.
    Gets the user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserMinEvictableIdleDuration

    public Duration getPerUserMinEvictableIdleDuration(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value, never null.
    Since:
      2.10.0

  - ### getPerUserMinEvictableIdleTimeMillis

    @Deprecated public long getPerUserMinEvictableIdleTimeMillis(String userName)
    Deprecated.
    Use `getPerUserMinEvictableIdleDuration(String)`.
    Gets the user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserMinIdle

    public int getPerUserMinIdle(String userName)
    Gets the user specific value for `GenericObjectPool.getMinIdle()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserNumTestsPerEvictionRun

    public int getPerUserNumTestsPerEvictionRun(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getNumTestsPerEvictionRun()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserSoftMinEvictableIdleDuration

    public Duration getPerUserSoftMinEvictableIdleDuration(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.
    Since:
      2.10.0

  - ### getPerUserSoftMinEvictableIdleTimeMillis

    @Deprecated public long getPerUserSoftMinEvictableIdleTimeMillis(String userName)
    Deprecated.
    Use `getPerUserSoftMinEvictableIdleDuration(String)`.
    Gets the user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserTestOnBorrow

    public boolean getPerUserTestOnBorrow(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getTestOnBorrow()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserTestOnCreate

    public boolean getPerUserTestOnCreate(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getTestOnCreate()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserTestOnReturn

    public boolean getPerUserTestOnReturn(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getTestOnReturn()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserTestWhileIdle

    public boolean getPerUserTestWhileIdle(String userName)
    Gets the user specific value for `BaseGenericObjectPool.getTestWhileIdle()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPerUserTimeBetweenEvictionRunsMillis

    @Deprecated public long getPerUserTimeBetweenEvictionRunsMillis(String userName)
    Deprecated.
    Use `getPerUserDurationBetweenEvictionRuns(String)`.
    Gets the user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool or the default if no user specific value is defined.
    Parameters:
      `userName` - The user name key.
    Returns:
      The user specific value.

  - ### getPooledConnectionAndInfo

    protected org.apache.tomcat.dbcp.dbcp2.datasources.PooledConnectionAndInfo getPooledConnectionAndInfo(String userName, String password) throws SQLException
    Description copied from class: `InstanceKeyDataSource`
    This method is protected but can only be implemented in this package because PooledConnectionAndInfo is a package private type.
    Specified by:
      `getPooledConnectionAndInfo` in class `InstanceKeyDataSource`
    Parameters:
      `userName` - The user name.
      `password` - The user password.
    Returns:
      Matching PooledConnectionAndInfo.
    Throws:
      `SQLException` - Connection or registration failure.

  - ### getReference

    public Reference getReference() throws NamingException
    Returns a `PerUserPoolDataSource` `Reference`.
    Throws:
      `NamingException`

  - ### setPerUserBlockWhenExhausted

    public void setPerUserBlockWhenExhausted(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getBlockWhenExhausted()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserDefaultAutoCommit

    public void setPerUserDefaultAutoCommit(String userName, Boolean value)
    Sets a user specific default value for `Connection.setAutoCommit(boolean)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserDefaultReadOnly

    public void setPerUserDefaultReadOnly(String userName, Boolean value)
    Sets a user specific default value for `Connection.setReadOnly(boolean)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserDefaultTransactionIsolation

    public void setPerUserDefaultTransactionIsolation(String userName, Integer value)
    Sets a user specific default value for `Connection.setTransactionIsolation(int)` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserDurationBetweenEvictionRuns

    public void setPerUserDurationBetweenEvictionRuns(String userName, Duration value)
    Sets a user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.
    Since:
      2.10.0

  - ### setPerUserEvictionPolicyClassName

    public void setPerUserEvictionPolicyClassName(String userName, String value)
    Sets a user specific value for `BaseGenericObjectPool.getEvictionPolicyClassName()` for the specified user's pool.

    The class must implement `EvictionPolicy`.

    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserLifo

    public void setPerUserLifo(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getLifo()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserMaxIdle

    public void setPerUserMaxIdle(String userName, Integer value)
    Sets a user specific value for `GenericObjectPool.getMaxIdle()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserMaxTotal

    public void setPerUserMaxTotal(String userName, Integer value)
    Sets a user specific value for `BaseGenericObjectPool.getMaxTotal()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserMaxWait

    public void setPerUserMaxWait(String userName, Duration value)
    Sets a user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.
    Since:
      2.10.0

  - ### setPerUserMaxWaitMillis

    @Deprecated public void setPerUserMaxWaitMillis(String userName, Long value)
    Deprecated.
    Use `setPerUserMaxWait(String, Duration)`.
    Sets a user specific value for `BaseGenericObjectPool.getMaxWaitDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserMinEvictableIdle

    public void setPerUserMinEvictableIdle(String userName, Duration value)
    Sets a user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.
    Since:
      2.10.0

  - ### setPerUserMinEvictableIdleTimeMillis

    @Deprecated public void setPerUserMinEvictableIdleTimeMillis(String userName, Long value)
    Deprecated.
    Use `setPerUserMinEvictableIdle(String, Duration)`.
    Sets a user specific value for `BaseGenericObjectPool.getMinEvictableIdleDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserMinIdle

    public void setPerUserMinIdle(String userName, Integer value)
    Sets a user specific value for `GenericObjectPool.getMinIdle()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserNumTestsPerEvictionRun

    public void setPerUserNumTestsPerEvictionRun(String userName, Integer value)
    Sets a user specific value for `BaseGenericObjectPool.getNumTestsPerEvictionRun()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserSoftMinEvictableIdle

    public void setPerUserSoftMinEvictableIdle(String userName, Duration value)
    Sets a user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.
    Since:
      2.10.0

  - ### setPerUserSoftMinEvictableIdleTimeMillis

    @Deprecated public void setPerUserSoftMinEvictableIdleTimeMillis(String userName, Long value)
    Deprecated.
    Use `setPerUserSoftMinEvictableIdle(String, Duration)`.
    Sets a user specific value for `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserTestOnBorrow

    public void setPerUserTestOnBorrow(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getTestOnBorrow()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserTestOnCreate

    public void setPerUserTestOnCreate(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getTestOnCreate()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserTestOnReturn

    public void setPerUserTestOnReturn(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getTestOnReturn()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserTestWhileIdle

    public void setPerUserTestWhileIdle(String userName, Boolean value)
    Sets a user specific value for `BaseGenericObjectPool.getTestWhileIdle()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setPerUserTimeBetweenEvictionRunsMillis

    @Deprecated public void setPerUserTimeBetweenEvictionRunsMillis(String userName, Long value)
    Deprecated.
    Use `setPerUserDurationBetweenEvictionRuns(String, Duration)`.
    Sets a user specific value for `BaseGenericObjectPool.getDurationBetweenEvictionRuns()` for the specified user's pool.
    Parameters:
      `userName` - The user name key.
      `value` - The user specific value.

  - ### setupDefaults

    protected void setupDefaults(Connection con, String userName) throws SQLException
    Description copied from class: `InstanceKeyDataSource`
    Sets up the defaults for a given connection.
    Specified by:
      `setupDefaults` in class `InstanceKeyDataSource`
    Parameters:
      `con` - The target connection.
      `userName` - The user name for the connection.
    Throws:
      `SQLException` - if a database access error occurs or this method is called on a closed connection