Class HikariConfig

    • Constructor Summary

      Constructors 
      Constructor Description
      HikariConfig()
      Default constructor
      HikariConfig​(java.lang.String propertyFileName)
      Construct a HikariConfig from the specified property file name.
      HikariConfig​(java.util.Properties properties)
      Construct a HikariConfig from the specified properties object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDataSourceProperty​(java.lang.String propertyName, java.lang.Object value)
      Add a property (name/value pair) that will be used to configure the DataSource/Driver.
      void addHealthCheckProperty​(java.lang.String key, java.lang.String value)  
      void copyStateTo​(HikariConfig other)
      Copies the state of this into other.
      java.lang.String getCatalog()
      Get the default catalog name to be set on connections.
      java.lang.String getConnectionInitSql()
      Get the SQL string that will be executed on all new connections when they are created, before they are added to the pool.
      java.lang.String getConnectionTestQuery()
      Get the SQL query to be executed to test the validity of connections.
      long getConnectionTimeout()
      Get the maximum number of milliseconds that a client will wait for a connection from the pool.
      javax.sql.DataSource getDataSource()
      Get the DataSource that has been explicitly specified to be wrapped by the pool.
      java.lang.String getDataSourceClassName()
      Get the name of the JDBC DataSource class used to create Connections.
      java.lang.String getDataSourceJNDI()  
      java.util.Properties getDataSourceProperties()  
      java.lang.String getDriverClassName()  
      java.lang.String getExceptionOverrideClassName()
      Get the user supplied SQLExceptionOverride class name.
      java.util.Properties getHealthCheckProperties()  
      java.lang.Object getHealthCheckRegistry()
      Get the HealthCheckRegistry that will be used for registration of health checks by HikariCP.
      long getIdleTimeout()
      This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.
      long getInitializationFailTimeout()
      Get the pool initialization failure timeout.
      java.lang.String getJdbcUrl()  
      long getKeepaliveTime()
      This property controls the keepalive interval for a connection in the pool.
      long getLeakDetectionThreshold()
      This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.
      int getMaximumPoolSize()
      The property controls the maximum number of connections that HikariCP will keep in the pool, including both idle and in-use connections.
      long getMaxLifetime()
      This property controls the maximum lifetime of a connection in the pool.
      java.lang.Object getMetricRegistry()
      Get the MetricRegistry instance to use for registration of metrics used by HikariCP.
      MetricsTrackerFactory getMetricsTrackerFactory()  
      int getMinimumIdle()
      The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.
      java.lang.String getPassword()
      Get the default password to use for DataSource.getConnection(username, password) calls.
      java.lang.String getPoolName()
      The name of the connection pool.
      java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
      Get the ScheduledExecutorService used for housekeeping.
      java.lang.String getSchema()
      Get the default schema name to be set on connections.
      java.util.concurrent.ThreadFactory getThreadFactory()
      Get the thread factory used to create threads.
      java.lang.String getTransactionIsolation()  
      java.lang.String getUsername()
      Get the default username used for DataSource.getConnection(username, password) calls.
      long getValidationTimeout()
      Get the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
      boolean isAllowPoolSuspension()
      Get the pool suspension behavior (allowed or disallowed).
      boolean isAutoCommit()
      Get the default auto-commit behavior of connections in the pool.
      boolean isIsolateInternalQueries()
      Determine whether internal pool queries, principally aliveness checks, will be isolated in their own transaction via Connection.rollback().
      boolean isReadOnly()
      Determine whether the Connections in the pool are in read-only mode.
      boolean isRegisterMbeans()
      Determine whether HikariCP will self-register HikariConfigMXBean and HikariPoolMXBean instances in JMX.
      void setAllowPoolSuspension​(boolean isAllowPoolSuspension)
      Set whether or not pool suspension is allowed.
      void setAutoCommit​(boolean isAutoCommit)
      Set the default auto-commit behavior of connections in the pool.
      void setCatalog​(java.lang.String catalog)
      Set the default catalog name to be set on connections.
      void setConnectionInitSql​(java.lang.String connectionInitSql)
      Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool.
      void setConnectionTestQuery​(java.lang.String connectionTestQuery)
      Set the SQL query to be executed to test the validity of connections.
      void setConnectionTimeout​(long connectionTimeoutMs)
      Set the maximum number of milliseconds that a client will wait for a connection from the pool.
      void setDataSource​(javax.sql.DataSource dataSource)
      Set a DataSource for the pool to explicitly wrap.
      void setDataSourceClassName​(java.lang.String className)
      Set the fully qualified class name of the JDBC DataSource that will be used create Connections.
      void setDataSourceJNDI​(java.lang.String jndiDataSource)  
      void setDataSourceProperties​(java.util.Properties dsProperties)  
      void setDriverClassName​(java.lang.String driverClassName)  
      void setExceptionOverrideClassName​(java.lang.String exceptionOverrideClassName)
      Set the user supplied SQLExceptionOverride class name.
      void setHealthCheckProperties​(java.util.Properties healthCheckProperties)  
      void setHealthCheckRegistry​(java.lang.Object healthCheckRegistry)
      Set the HealthCheckRegistry that will be used for registration of health checks by HikariCP.
      void setIdleTimeout​(long idleTimeoutMs)
      This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.
      void setInitializationFailTimeout​(long initializationFailTimeout)
      Set the pool initialization failure timeout.
      void setIsolateInternalQueries​(boolean isolate)
      Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction via Connection.rollback().
      void setJdbcUrl​(java.lang.String jdbcUrl)  
      void setKeepaliveTime​(long keepaliveTimeMs)
      This property controls the keepalive interval for a connection in the pool.
      void setLeakDetectionThreshold​(long leakDetectionThresholdMs)
      This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak.
      void setMaximumPoolSize​(int maxPoolSize)
      The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.
      void setMaxLifetime​(long maxLifetimeMs)
      This property controls the maximum lifetime of a connection in the pool.
      void setMetricRegistry​(java.lang.Object metricRegistry)
      Set a MetricRegistry instance to use for registration of metrics used by HikariCP.
      void setMetricsTrackerFactory​(MetricsTrackerFactory metricsTrackerFactory)  
      void setMinimumIdle​(int minIdle)
      The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections.
      void setPassword​(java.lang.String password)
      Set the default password to use for DataSource.getConnection(username, password) calls.
      void setPoolName​(java.lang.String poolName)
      Set the name of the connection pool.
      void setReadOnly​(boolean readOnly)
      Configures the Connections to be added to the pool as read-only Connections.
      void setRegisterMbeans​(boolean register)
      Configures whether HikariCP self-registers the HikariConfigMXBean and HikariPoolMXBean in JMX.
      void setScheduledExecutor​(java.util.concurrent.ScheduledExecutorService executor)
      Set the ScheduledExecutorService used for housekeeping.
      void setSchema​(java.lang.String schema)
      Set the default schema name to be set on connections.
      void setThreadFactory​(java.util.concurrent.ThreadFactory threadFactory)
      Set the thread factory to be used to create threads.
      void setTransactionIsolation​(java.lang.String isolationLevel)
      Set the default transaction isolation level.
      void setUsername​(java.lang.String username)
      Set the default username used for DataSource.getConnection(username, password) calls.
      void setValidationTimeout​(long validationTimeoutMs)
      Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
      void validate()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HikariConfig

        public HikariConfig()
        Default constructor
      • HikariConfig

        public HikariConfig​(java.util.Properties properties)
        Construct a HikariConfig from the specified properties object.
        Parameters:
        properties - the name of the property file
      • HikariConfig

        public HikariConfig​(java.lang.String propertyFileName)
        Construct a HikariConfig from the specified property file name. propertyFileName will first be treated as a path in the file-system, and if that fails the Class.getResourceAsStream(propertyFileName) will be tried.
        Parameters:
        propertyFileName - the name of the property file
    • Method Detail

      • getCatalog

        public java.lang.String getCatalog()
        Get the default catalog name to be set on connections.
        Specified by:
        getCatalog in interface HikariConfigMXBean
        Returns:
        the default catalog name
      • setCatalog

        public void setCatalog​(java.lang.String catalog)
        Set the default catalog name to be set on connections.

        WARNING: THIS VALUE SHOULD ONLY BE CHANGED WHILE THE POOL IS SUSPENDED, AFTER CONNECTIONS HAVE BEEN EVICTED.

        Specified by:
        setCatalog in interface HikariConfigMXBean
        Parameters:
        catalog - the catalog name, or null
      • getConnectionTimeout

        public long getConnectionTimeout()
        Get the maximum number of milliseconds that a client will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown from DataSource.getConnection().
        Specified by:
        getConnectionTimeout in interface HikariConfigMXBean
        Returns:
        the connection timeout in milliseconds
      • setConnectionTimeout

        public void setConnectionTimeout​(long connectionTimeoutMs)
        Set the maximum number of milliseconds that a client will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown from DataSource.getConnection().
        Specified by:
        setConnectionTimeout in interface HikariConfigMXBean
        Parameters:
        connectionTimeoutMs - the connection timeout in milliseconds
      • getIdleTimeout

        public long getIdleTimeout()
        This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30 seconds, and average variation of +15 seconds. A connection will never be retired as idle before this timeout. A value of 0 means that idle connections are never removed from the pool.
        Specified by:
        getIdleTimeout in interface HikariConfigMXBean
        Returns:
        the idle timeout in milliseconds
      • setIdleTimeout

        public void setIdleTimeout​(long idleTimeoutMs)
        This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool. Whether a connection is retired as idle or not is subject to a maximum variation of +30 seconds, and average variation of +15 seconds. A connection will never be retired as idle before this timeout. A value of 0 means that idle connections are never removed from the pool.
        Specified by:
        setIdleTimeout in interface HikariConfigMXBean
        Parameters:
        idleTimeoutMs - the idle timeout in milliseconds
      • getLeakDetectionThreshold

        public long getLeakDetectionThreshold()
        This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled.
        Specified by:
        getLeakDetectionThreshold in interface HikariConfigMXBean
        Returns:
        the connection leak detection threshold in milliseconds
      • setLeakDetectionThreshold

        public void setLeakDetectionThreshold​(long leakDetectionThresholdMs)
        This property controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. A value of 0 means leak detection is disabled.
        Specified by:
        setLeakDetectionThreshold in interface HikariConfigMXBean
        Parameters:
        leakDetectionThresholdMs - the connection leak detection threshold in milliseconds
      • getMaxLifetime

        public long getMaxLifetime()
        This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed.
        Specified by:
        getMaxLifetime in interface HikariConfigMXBean
        Returns:
        the maximum connection lifetime in milliseconds
      • setMaxLifetime

        public void setMaxLifetime​(long maxLifetimeMs)
        This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed.
        Specified by:
        setMaxLifetime in interface HikariConfigMXBean
        Parameters:
        maxLifetimeMs - the maximum connection lifetime in milliseconds
      • getMaximumPoolSize

        public int getMaximumPoolSize()
        The property controls the maximum number of connections that HikariCP will keep in the pool, including both idle and in-use connections.
        Specified by:
        getMaximumPoolSize in interface HikariConfigMXBean
        Returns:
        the maximum number of connections in the pool
      • setMaximumPoolSize

        public void setMaximumPoolSize​(int maxPoolSize)
        The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections. Basically this value will determine the maximum number of actual connections to the database backend.

        When the pool reaches this size, and no idle connections are available, calls to getConnection() will block for up to connectionTimeout milliseconds before timing out.

        Specified by:
        setMaximumPoolSize in interface HikariConfigMXBean
        Parameters:
        maxPoolSize - the maximum number of connections in the pool
      • getMinimumIdle

        public int getMinimumIdle()
        The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. If the idle connections dip below this value, HikariCP will make a best effort to restore them quickly and efficiently.
        Specified by:
        getMinimumIdle in interface HikariConfigMXBean
        Returns:
        the minimum number of connections in the pool
      • setMinimumIdle

        public void setMinimumIdle​(int minIdle)
        The property controls the minimum number of idle connections that HikariCP tries to maintain in the pool, including both idle and in-use connections. If the idle connections dip below this value, HikariCP will make a best effort to restore them quickly and efficiently.
        Specified by:
        setMinimumIdle in interface HikariConfigMXBean
        Parameters:
        minIdle - the minimum number of idle connections in the pool to maintain
      • getPassword

        public java.lang.String getPassword()
        Get the default password to use for DataSource.getConnection(username, password) calls.
        Returns:
        the password
      • setPassword

        public void setPassword​(java.lang.String password)
        Set the default password to use for DataSource.getConnection(username, password) calls.
        Specified by:
        setPassword in interface HikariConfigMXBean
        Parameters:
        password - the password
      • getUsername

        public java.lang.String getUsername()
        Get the default username used for DataSource.getConnection(username, password) calls.
        Returns:
        the username
      • setUsername

        public void setUsername​(java.lang.String username)
        Set the default username used for DataSource.getConnection(username, password) calls.
        Specified by:
        setUsername in interface HikariConfigMXBean
        Parameters:
        username - the username
      • getValidationTimeout

        public long getValidationTimeout()
        Get the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
        Specified by:
        getValidationTimeout in interface HikariConfigMXBean
        Returns:
        the validation timeout in milliseconds
      • setValidationTimeout

        public void setValidationTimeout​(long validationTimeoutMs)
        Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.
        Specified by:
        setValidationTimeout in interface HikariConfigMXBean
        Parameters:
        validationTimeoutMs - the validation timeout in milliseconds
      • getConnectionTestQuery

        public java.lang.String getConnectionTestQuery()
        Get the SQL query to be executed to test the validity of connections.
        Returns:
        the SQL query string, or null
      • setConnectionTestQuery

        public void setConnectionTestQuery​(java.lang.String connectionTestQuery)
        Set the SQL query to be executed to test the validity of connections. Using the JDBC4 Connection.isValid() method to test connection validity can be more efficient on some databases and is recommended.
        Parameters:
        connectionTestQuery - a SQL query string
      • getConnectionInitSql

        public java.lang.String getConnectionInitSql()
        Get the SQL string that will be executed on all new connections when they are created, before they are added to the pool.
        Returns:
        the SQL to execute on new connections, or null
      • setConnectionInitSql

        public void setConnectionInitSql​(java.lang.String connectionInitSql)
        Set the SQL string that will be executed on all new connections when they are created, before they are added to the pool. If this query fails, it will be treated as a failed connection attempt.
        Parameters:
        connectionInitSql - the SQL to execute on new connections
      • getDataSource

        public javax.sql.DataSource getDataSource()
        Get the DataSource that has been explicitly specified to be wrapped by the pool.
        Returns:
        the DataSource instance, or null
      • setDataSource

        public void setDataSource​(javax.sql.DataSource dataSource)
        Set a DataSource for the pool to explicitly wrap. This setter is not available through property file based initialization.
        Parameters:
        dataSource - a specific DataSource to be wrapped by the pool
      • getDataSourceClassName

        public java.lang.String getDataSourceClassName()
        Get the name of the JDBC DataSource class used to create Connections.
        Returns:
        the fully qualified name of the JDBC DataSource class
      • setDataSourceClassName

        public void setDataSourceClassName​(java.lang.String className)
        Set the fully qualified class name of the JDBC DataSource that will be used create Connections.
        Parameters:
        className - the fully qualified name of the JDBC DataSource class
      • addDataSourceProperty

        public void addDataSourceProperty​(java.lang.String propertyName,
                                          java.lang.Object value)
        Add a property (name/value pair) that will be used to configure the DataSource/Driver. In the case of a DataSource, the property names will be translated to Java setters following the Java Bean naming convention. For example, the property cachePrepStmts will translate into setCachePrepStmts() with the value passed as a parameter. In the case of a Driver, the property will be added to a Properties instance that will be passed to the driver during Driver.connect(String, Properties) calls.
        Parameters:
        propertyName - the name of the property
        value - the value to be used by the DataSource/Driver
      • getDataSourceJNDI

        public java.lang.String getDataSourceJNDI()
      • setDataSourceJNDI

        public void setDataSourceJNDI​(java.lang.String jndiDataSource)
      • getDataSourceProperties

        public java.util.Properties getDataSourceProperties()
      • setDataSourceProperties

        public void setDataSourceProperties​(java.util.Properties dsProperties)
      • getDriverClassName

        public java.lang.String getDriverClassName()
      • setDriverClassName

        public void setDriverClassName​(java.lang.String driverClassName)
      • getJdbcUrl

        public java.lang.String getJdbcUrl()
      • setJdbcUrl

        public void setJdbcUrl​(java.lang.String jdbcUrl)
      • isAutoCommit

        public boolean isAutoCommit()
        Get the default auto-commit behavior of connections in the pool.
        Returns:
        the default auto-commit behavior of connections
      • setAutoCommit

        public void setAutoCommit​(boolean isAutoCommit)
        Set the default auto-commit behavior of connections in the pool.
        Parameters:
        isAutoCommit - the desired auto-commit default for connections
      • isAllowPoolSuspension

        public boolean isAllowPoolSuspension()
        Get the pool suspension behavior (allowed or disallowed).
        Returns:
        the pool suspension behavior
      • setAllowPoolSuspension

        public void setAllowPoolSuspension​(boolean isAllowPoolSuspension)
        Set whether or not pool suspension is allowed. There is a performance impact when pool suspension is enabled. Unless you need it (for a redundancy system for example) do not enable it.
        Parameters:
        isAllowPoolSuspension - the desired pool suspension allowance
      • getInitializationFailTimeout

        public long getInitializationFailTimeout()
        Get the pool initialization failure timeout. See #setInitializationFailTimeout(long) for details.
        Returns:
        the number of milliseconds before the pool initialization fails
        See Also:
        setInitializationFailTimeout(long)
      • setInitializationFailTimeout

        public void setInitializationFailTimeout​(long initializationFailTimeout)
        Set the pool initialization failure timeout. This setting applies to pool initialization when HikariDataSource is constructed with a HikariConfig, or when HikariDataSource is constructed using the no-arg constructor and HikariDataSource.getConnection() is called.
        • Any value greater than zero will be treated as a timeout for pool initialization. The calling thread will be blocked from continuing until a successful connection to the database, or until the timeout is reached. If the timeout is reached, then a PoolInitializationException will be thrown.
        • A value of zero will not prevent the pool from starting in the case that a connection cannot be obtained. However, upon start the pool will attempt to obtain a connection and validate that the connectionTestQuery and connectionInitSql are valid. If those validations fail, an exception will be thrown. If a connection cannot be obtained, the validation is skipped and the the pool will start and continue to try to obtain connections in the background. This can mean that callers to DataSource#getConnection() may encounter exceptions.
        • A value less than zero will bypass any connection attempt and validation during startup, and therefore the pool will start immediately. The pool will continue to try to obtain connections in the background. This can mean that callers to DataSource#getConnection() may encounter exceptions.
        Note that if this timeout value is greater than or equal to zero (0), and therefore an initial connection validation is performed, this timeout does not override the connectionTimeout or validationTimeout; they will be honored before this timeout is applied. The default value is one millisecond.
        Parameters:
        initializationFailTimeout - the number of milliseconds before the pool initialization fails, or 0 to validate connection setup but continue with pool start, or less than zero to skip all initialization checks and start the pool without delay.
      • isIsolateInternalQueries

        public boolean isIsolateInternalQueries()
        Determine whether internal pool queries, principally aliveness checks, will be isolated in their own transaction via Connection.rollback(). Defaults to false.
        Returns:
        true if internal pool queries are isolated, false if not
      • setIsolateInternalQueries

        public void setIsolateInternalQueries​(boolean isolate)
        Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction via Connection.rollback(). Defaults to false.
        Parameters:
        isolate - true if internal pool queries should be isolated, false if not
      • setMetricsTrackerFactory

        public void setMetricsTrackerFactory​(MetricsTrackerFactory metricsTrackerFactory)
      • getMetricRegistry

        public java.lang.Object getMetricRegistry()
        Get the MetricRegistry instance to use for registration of metrics used by HikariCP. Default is null.
        Returns:
        the MetricRegistry instance that will be used
      • setMetricRegistry

        public void setMetricRegistry​(java.lang.Object metricRegistry)
        Set a MetricRegistry instance to use for registration of metrics used by HikariCP.
        Parameters:
        metricRegistry - the MetricRegistry instance to use
      • getHealthCheckRegistry

        public java.lang.Object getHealthCheckRegistry()
        Get the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only Codahale/DropWizard is supported for health checks.
        Returns:
        the HealthCheckRegistry instance that will be used
      • setHealthCheckRegistry

        public void setHealthCheckRegistry​(java.lang.Object healthCheckRegistry)
        Set the HealthCheckRegistry that will be used for registration of health checks by HikariCP. Currently only Codahale/DropWizard is supported for health checks. Default is null.
        Parameters:
        healthCheckRegistry - the HealthCheckRegistry to be used
      • getHealthCheckProperties

        public java.util.Properties getHealthCheckProperties()
      • setHealthCheckProperties

        public void setHealthCheckProperties​(java.util.Properties healthCheckProperties)
      • addHealthCheckProperty

        public void addHealthCheckProperty​(java.lang.String key,
                                           java.lang.String value)
      • getKeepaliveTime

        public long getKeepaliveTime()
        This property controls the keepalive interval for a connection in the pool. An in-use connection will never be tested by the keepalive thread, only when it is idle will it be tested.
        Returns:
        the interval in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Value is in milliseconds, default is 0 (disabled).
      • setKeepaliveTime

        public void setKeepaliveTime​(long keepaliveTimeMs)
        This property controls the keepalive interval for a connection in the pool. An in-use connection will never be tested by the keepalive thread, only when it is idle will it be tested.
        Parameters:
        keepaliveTimeMs - the interval in which connections will be tested for aliveness, thus keeping them alive by the act of checking. Value is in milliseconds, default is 0 (disabled).
      • isReadOnly

        public boolean isReadOnly()
        Determine whether the Connections in the pool are in read-only mode.
        Returns:
        true if the Connections in the pool are read-only, false if not
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Configures the Connections to be added to the pool as read-only Connections.
        Parameters:
        readOnly - true if the Connections in the pool are read-only, false if not
      • isRegisterMbeans

        public boolean isRegisterMbeans()
        Determine whether HikariCP will self-register HikariConfigMXBean and HikariPoolMXBean instances in JMX.
        Returns:
        true if HikariCP will register MXBeans, false if it will not
      • setRegisterMbeans

        public void setRegisterMbeans​(boolean register)
        Configures whether HikariCP self-registers the HikariConfigMXBean and HikariPoolMXBean in JMX.
        Parameters:
        register - true if HikariCP should register MXBeans, false if it should not
      • getPoolName

        public java.lang.String getPoolName()
        The name of the connection pool.
        Specified by:
        getPoolName in interface HikariConfigMXBean
        Returns:
        the name of the connection pool
      • setPoolName

        public void setPoolName​(java.lang.String poolName)
        Set the name of the connection pool. This is primarily used for the MBean to uniquely identify the pool configuration.
        Parameters:
        poolName - the name of the connection pool to use
      • getScheduledExecutor

        public java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
        Get the ScheduledExecutorService used for housekeeping.
        Returns:
        the executor
      • setScheduledExecutor

        public void setScheduledExecutor​(java.util.concurrent.ScheduledExecutorService executor)
        Set the ScheduledExecutorService used for housekeeping.
        Parameters:
        executor - the ScheduledExecutorService
      • getTransactionIsolation

        public java.lang.String getTransactionIsolation()
      • getSchema

        public java.lang.String getSchema()
        Get the default schema name to be set on connections.
        Returns:
        the default schema name
      • setSchema

        public void setSchema​(java.lang.String schema)
        Set the default schema name to be set on connections.
        Parameters:
        schema - the name of the default schema
      • getExceptionOverrideClassName

        public java.lang.String getExceptionOverrideClassName()
        Get the user supplied SQLExceptionOverride class name.
        Returns:
        the user supplied SQLExceptionOverride class name
        See Also:
        SQLExceptionOverride
      • setExceptionOverrideClassName

        public void setExceptionOverrideClassName​(java.lang.String exceptionOverrideClassName)
        Set the user supplied SQLExceptionOverride class name.
        Parameters:
        exceptionOverrideClassName - the user supplied SQLExceptionOverride class name
        See Also:
        SQLExceptionOverride
      • setTransactionIsolation

        public void setTransactionIsolation​(java.lang.String isolationLevel)
        Set the default transaction isolation level. The specified value is the constant name from the Connection class, eg. TRANSACTION_REPEATABLE_READ.
        Parameters:
        isolationLevel - the name of the isolation level
      • getThreadFactory

        public java.util.concurrent.ThreadFactory getThreadFactory()
        Get the thread factory used to create threads.
        Returns:
        the thread factory (may be null, in which case the default thread factory is used)
      • setThreadFactory

        public void setThreadFactory​(java.util.concurrent.ThreadFactory threadFactory)
        Set the thread factory to be used to create threads.
        Parameters:
        threadFactory - the thread factory (setting to null causes the default thread factory to be used)
      • copyStateTo

        public void copyStateTo​(HikariConfig other)
        Copies the state of this into other.
        Parameters:
        other - Other HikariConfig to copy the state to.
      • validate

        public void validate()