Package com.zaxxer.hikari
Class HikariConfig
- java.lang.Object
-
- com.zaxxer.hikari.HikariConfig
-
- All Implemented Interfaces:
HikariConfigMXBean
- Direct Known Subclasses:
HikariDataSource
public class HikariConfig extends java.lang.Object implements HikariConfigMXBean
-
-
Constructor Summary
Constructors Constructor Description HikariConfig()Default constructorHikariConfig(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 voidaddDataSourceProperty(java.lang.String propertyName, java.lang.Object value)Add a property (name/value pair) that will be used to configure theDataSource/Driver.voidaddHealthCheckProperty(java.lang.String key, java.lang.String value)voidcopyStateTo(HikariConfig other)Copies the state ofthisintoother.java.lang.StringgetCatalog()Get the default catalog name to be set on connections.java.lang.StringgetConnectionInitSql()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.StringgetConnectionTestQuery()Get the SQL query to be executed to test the validity of connections.longgetConnectionTimeout()Get the maximum number of milliseconds that a client will wait for a connection from the pool.javax.sql.DataSourcegetDataSource()Get theDataSourcethat has been explicitly specified to be wrapped by the pool.java.lang.StringgetDataSourceClassName()Get the name of the JDBCDataSourceclass used to create Connections.java.lang.StringgetDataSourceJNDI()java.util.PropertiesgetDataSourceProperties()java.lang.StringgetDriverClassName()java.lang.StringgetExceptionOverrideClassName()Get the user supplied SQLExceptionOverride class name.java.util.PropertiesgetHealthCheckProperties()java.lang.ObjectgetHealthCheckRegistry()Get the HealthCheckRegistry that will be used for registration of health checks by HikariCP.longgetIdleTimeout()This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.longgetInitializationFailTimeout()Get the pool initialization failure timeout.java.lang.StringgetJdbcUrl()longgetKeepaliveTime()This property controls the keepalive interval for a connection in the pool.longgetLeakDetectionThreshold()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.intgetMaximumPoolSize()The property controls the maximum number of connections that HikariCP will keep in the pool, including both idle and in-use connections.longgetMaxLifetime()This property controls the maximum lifetime of a connection in the pool.java.lang.ObjectgetMetricRegistry()Get the MetricRegistry instance to use for registration of metrics used by HikariCP.MetricsTrackerFactorygetMetricsTrackerFactory()intgetMinimumIdle()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.StringgetPassword()Get the default password to use for DataSource.getConnection(username, password) calls.java.lang.StringgetPoolName()The name of the connection pool.java.util.concurrent.ScheduledExecutorServicegetScheduledExecutor()Get the ScheduledExecutorService used for housekeeping.java.lang.StringgetSchema()Get the default schema name to be set on connections.java.util.concurrent.ThreadFactorygetThreadFactory()Get the thread factory used to create threads.java.lang.StringgetTransactionIsolation()java.lang.StringgetUsername()Get the default username used for DataSource.getConnection(username, password) calls.longgetValidationTimeout()Get the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.booleanisAllowPoolSuspension()Get the pool suspension behavior (allowed or disallowed).booleanisAutoCommit()Get the default auto-commit behavior of connections in the pool.booleanisIsolateInternalQueries()Determine whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback().booleanisReadOnly()Determine whether the Connections in the pool are in read-only mode.booleanisRegisterMbeans()Determine whether HikariCP will self-registerHikariConfigMXBeanandHikariPoolMXBeaninstances in JMX.voidsetAllowPoolSuspension(boolean isAllowPoolSuspension)Set whether or not pool suspension is allowed.voidsetAutoCommit(boolean isAutoCommit)Set the default auto-commit behavior of connections in the pool.voidsetCatalog(java.lang.String catalog)Set the default catalog name to be set on connections.voidsetConnectionInitSql(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.voidsetConnectionTestQuery(java.lang.String connectionTestQuery)Set the SQL query to be executed to test the validity of connections.voidsetConnectionTimeout(long connectionTimeoutMs)Set the maximum number of milliseconds that a client will wait for a connection from the pool.voidsetDataSource(javax.sql.DataSource dataSource)Set aDataSourcefor the pool to explicitly wrap.voidsetDataSourceClassName(java.lang.String className)Set the fully qualified class name of the JDBCDataSourcethat will be used create Connections.voidsetDataSourceJNDI(java.lang.String jndiDataSource)voidsetDataSourceProperties(java.util.Properties dsProperties)voidsetDriverClassName(java.lang.String driverClassName)voidsetExceptionOverrideClassName(java.lang.String exceptionOverrideClassName)Set the user supplied SQLExceptionOverride class name.voidsetHealthCheckProperties(java.util.Properties healthCheckProperties)voidsetHealthCheckRegistry(java.lang.Object healthCheckRegistry)Set the HealthCheckRegistry that will be used for registration of health checks by HikariCP.voidsetIdleTimeout(long idleTimeoutMs)This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool.voidsetInitializationFailTimeout(long initializationFailTimeout)Set the pool initialization failure timeout.voidsetIsolateInternalQueries(boolean isolate)Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback().voidsetJdbcUrl(java.lang.String jdbcUrl)voidsetKeepaliveTime(long keepaliveTimeMs)This property controls the keepalive interval for a connection in the pool.voidsetLeakDetectionThreshold(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.voidsetMaximumPoolSize(int maxPoolSize)The property controls the maximum size that the pool is allowed to reach, including both idle and in-use connections.voidsetMaxLifetime(long maxLifetimeMs)This property controls the maximum lifetime of a connection in the pool.voidsetMetricRegistry(java.lang.Object metricRegistry)Set a MetricRegistry instance to use for registration of metrics used by HikariCP.voidsetMetricsTrackerFactory(MetricsTrackerFactory metricsTrackerFactory)voidsetMinimumIdle(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.voidsetPassword(java.lang.String password)Set the default password to use for DataSource.getConnection(username, password) calls.voidsetPoolName(java.lang.String poolName)Set the name of the connection pool.voidsetReadOnly(boolean readOnly)Configures the Connections to be added to the pool as read-only Connections.voidsetRegisterMbeans(boolean register)Configures whether HikariCP self-registers theHikariConfigMXBeanandHikariPoolMXBeanin JMX.voidsetScheduledExecutor(java.util.concurrent.ScheduledExecutorService executor)Set the ScheduledExecutorService used for housekeeping.voidsetSchema(java.lang.String schema)Set the default schema name to be set on connections.voidsetThreadFactory(java.util.concurrent.ThreadFactory threadFactory)Set the thread factory to be used to create threads.voidsetTransactionIsolation(java.lang.String isolationLevel)Set the default transaction isolation level.voidsetUsername(java.lang.String username)Set the default username used for DataSource.getConnection(username, password) calls.voidsetValidationTimeout(long validationTimeoutMs)Sets the maximum number of milliseconds that the pool will wait for a connection to be validated as alive.voidvalidate()
-
-
-
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.propertyFileNamewill 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:
getCatalogin interfaceHikariConfigMXBean- 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:
setCatalogin interfaceHikariConfigMXBean- 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 fromDataSource.getConnection().- Specified by:
getConnectionTimeoutin interfaceHikariConfigMXBean- 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 fromDataSource.getConnection().- Specified by:
setConnectionTimeoutin interfaceHikariConfigMXBean- 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:
getIdleTimeoutin interfaceHikariConfigMXBean- 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:
setIdleTimeoutin interfaceHikariConfigMXBean- 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:
getLeakDetectionThresholdin interfaceHikariConfigMXBean- 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:
setLeakDetectionThresholdin interfaceHikariConfigMXBean- 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:
getMaxLifetimein interfaceHikariConfigMXBean- 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:
setMaxLifetimein interfaceHikariConfigMXBean- 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:
getMaximumPoolSizein interfaceHikariConfigMXBean- 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:
setMaximumPoolSizein interfaceHikariConfigMXBean- 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:
getMinimumIdlein interfaceHikariConfigMXBean- 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:
setMinimumIdlein interfaceHikariConfigMXBean- 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:
setPasswordin interfaceHikariConfigMXBean- 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:
setUsernamein interfaceHikariConfigMXBean- 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:
getValidationTimeoutin interfaceHikariConfigMXBean- 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:
setValidationTimeoutin interfaceHikariConfigMXBean- 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 JDBC4Connection.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 theDataSourcethat has been explicitly specified to be wrapped by the pool.- Returns:
- the
DataSourceinstance, or null
-
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
Set aDataSourcefor the pool to explicitly wrap. This setter is not available through property file based initialization.- Parameters:
dataSource- a specificDataSourceto be wrapped by the pool
-
getDataSourceClassName
public java.lang.String getDataSourceClassName()
Get the name of the JDBCDataSourceclass used to create Connections.- Returns:
- the fully qualified name of the JDBC
DataSourceclass
-
setDataSourceClassName
public void setDataSourceClassName(java.lang.String className)
Set the fully qualified class name of the JDBCDataSourcethat will be used create Connections.- Parameters:
className- the fully qualified name of the JDBCDataSourceclass
-
addDataSourceProperty
public void addDataSourceProperty(java.lang.String propertyName, java.lang.Object value)Add a property (name/value pair) that will be used to configure theDataSource/Driver. In the case of aDataSource, the property names will be translated to Java setters following the Java Bean naming convention. For example, the propertycachePrepStmtswill translate intosetCachePrepStmts()with thevaluepassed as a parameter. In the case of aDriver, the property will be added to aPropertiesinstance that will be passed to the driver duringDriver.connect(String, Properties)calls.- Parameters:
propertyName- the name of the propertyvalue- 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 whenHikariDataSourceis constructed with aHikariConfig, or whenHikariDataSourceis constructed using the no-arg constructor andHikariDataSource.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
PoolInitializationExceptionwill 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
connectionTestQueryandconnectionInitSqlare 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 toDataSource#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.
connectionTimeoutorvalidationTimeout; 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.
- 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
-
isIsolateInternalQueries
public boolean isIsolateInternalQueries()
Determine whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback(). Defaults tofalse.- Returns:
trueif internal pool queries are isolated,falseif not
-
setIsolateInternalQueries
public void setIsolateInternalQueries(boolean isolate)
Configure whether internal pool queries, principally aliveness checks, will be isolated in their own transaction viaConnection.rollback(). Defaults tofalse.- Parameters:
isolate-trueif internal pool queries should be isolated,falseif not
-
getMetricsTrackerFactory
public MetricsTrackerFactory getMetricsTrackerFactory()
-
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 isnull.- 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 isnull.- 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:
trueif the Connections in the pool are read-only,falseif not
-
setReadOnly
public void setReadOnly(boolean readOnly)
Configures the Connections to be added to the pool as read-only Connections.- Parameters:
readOnly-trueif the Connections in the pool are read-only,falseif not
-
isRegisterMbeans
public boolean isRegisterMbeans()
Determine whether HikariCP will self-registerHikariConfigMXBeanandHikariPoolMXBeaninstances in JMX.- Returns:
trueif HikariCP will register MXBeans,falseif it will not
-
setRegisterMbeans
public void setRegisterMbeans(boolean register)
Configures whether HikariCP self-registers theHikariConfigMXBeanandHikariPoolMXBeanin JMX.- Parameters:
register-trueif HikariCP should register MXBeans,falseif it should not
-
getPoolName
public java.lang.String getPoolName()
The name of the connection pool.- Specified by:
getPoolNamein interfaceHikariConfigMXBean- 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 theConnectionclass, 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 ofthisintoother.- Parameters:
other- OtherHikariConfigto copy the state to.
-
validate
public void validate()
-
-