HikariConfigMXBean, Closeable, AutoCloseable, Wrapper, CommonDataSource, DataSourcepublic class HikariDataSource extends HikariConfig implements DataSource, Closeable
| Constructor | Description |
|---|---|
HikariDataSource() |
Default constructor.
|
HikariDataSource(HikariConfig configuration) |
Construct a HikariDataSource with the specified configuration.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Shutdown the DataSource and its associated pool.
|
void |
evictConnection(Connection connection) |
Evict a connection from the pool.
|
Connection |
getConnection() |
|
Connection |
getConnection(String username,
String password) |
|
HikariConfigMXBean |
getHikariConfigMXBean() |
Get the
HikariConfigMXBean for this HikariDataSource instance. |
HikariPoolMXBean |
getHikariPoolMXBean() |
Get the
HikariPoolMXBean for this HikariDataSource instance. |
int |
getLoginTimeout() |
|
PrintWriter |
getLogWriter() |
|
Logger |
getParentLogger() |
|
boolean |
isClosed() |
Determine whether the HikariDataSource has been closed.
|
boolean |
isWrapperFor(Class<?> iface) |
|
void |
resumePool() |
Deprecated.
Call the
HikariPoolMXBean#resumePool() method on the HikariPoolMXBean
obtained by #getHikariPoolMXBean() or JMX lookup. |
void |
setHealthCheckRegistry(Object healthCheckRegistry) |
Set a Codahale HealthCheckRegistry to use for HikariCP.
|
void |
setLoginTimeout(int seconds) |
|
void |
setLogWriter(PrintWriter out) |
|
void |
setMetricRegistry(Object metricRegistry) |
Set a Codahale MetricRegistry to use for HikariCP.
|
void |
setMetricsTrackerFactory(MetricsTrackerFactory metricsTrackerFactory) |
|
void |
shutdown() |
Deprecated.
This method has been deprecated, please use
close() instead |
void |
suspendPool() |
Deprecated.
Call the
HikariPoolMXBean#suspendPool() method on the HikariPoolMXBean
obtained by #getHikariPoolMXBean() or JMX lookup. |
String |
toString() |
|
<T> T |
unwrap(Class<T> iface) |
createShardingKeyBuildercreateConnectionBuilderaddDataSourceProperty, addHealthCheckProperty, copyState, getCatalog, getConnectionInitSql, getConnectionTestQuery, getConnectionTimeout, getDataSource, getDataSourceClassName, getDataSourceJNDI, getDataSourceProperties, getDriverClassName, getHealthCheckProperties, getHealthCheckRegistry, getIdleTimeout, getInitializationFailTimeout, getJdbcUrl, getLeakDetectionThreshold, getMaximumPoolSize, getMaxLifetime, getMetricRegistry, getMetricsTrackerFactory, getMinimumIdle, getPassword, getPoolName, getScheduledExecutor, getScheduledExecutorService, getThreadFactory, getTransactionIsolation, getUsername, getValidationTimeout, isAllowPoolSuspension, isAutoCommit, isInitializationFailFast, isIsolateInternalQueries, isJdbc4ConnectionTest, isReadOnly, isRegisterMbeans, setAllowPoolSuspension, setAutoCommit, setCatalog, setConnectionInitSql, setConnectionTestQuery, setConnectionTimeout, setDataSource, setDataSourceClassName, setDataSourceJNDI, setDataSourceProperties, setDriverClassName, setHealthCheckProperties, setIdleTimeout, setInitializationFailFast, setInitializationFailTimeout, setIsolateInternalQueries, setJdbc4ConnectionTest, setJdbcUrl, setLeakDetectionThreshold, setMaximumPoolSize, setMaxLifetime, setMinimumIdle, setPassword, setPoolName, setReadOnly, setRegisterMbeans, setScheduledExecutor, setScheduledExecutorService, setThreadFactory, setTransactionIsolation, setUsername, setValidationTimeout, validatepublic HikariDataSource()
HikariDataSource(HikariConfig) will
result in getConnection() performance that is slightly lower
due to lazy initialization checks.public HikariDataSource(HikariConfig configuration)
configuration - a HikariConfig instancepublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourcegetLogWriter in interface DataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourcesetLogWriter in interface DataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourcesetLoginTimeout in interface DataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourcegetLoginTimeout in interface DataSourceSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setMetricRegistry(Object metricRegistry)
setMetricRegistry in class HikariConfigmetricRegistry - the Codahale MetricRegistry to setpublic void setMetricsTrackerFactory(MetricsTrackerFactory metricsTrackerFactory)
setMetricsTrackerFactory in class HikariConfigpublic void setHealthCheckRegistry(Object healthCheckRegistry)
setHealthCheckRegistry in class HikariConfighealthCheckRegistry - the Codahale HealthCheckRegistry to setpublic HikariPoolMXBean getHikariPoolMXBean()
HikariPoolMXBean for this HikariDataSource instance. If this method is called on
a HikariDataSource that has been constructed without a HikariConfig instance,
and before an initial call to #getConnection(), the return value will be null.HikariPoolMXBean instance, or null.public HikariConfigMXBean getHikariConfigMXBean()
HikariConfigMXBean for this HikariDataSource instance.HikariConfigMXBean instance.public void evictConnection(Connection connection)
connection - the connection to evict from the pool@Deprecated public void suspendPool()
HikariPoolMXBean#suspendPool() method on the HikariPoolMXBean
obtained by #getHikariPoolMXBean() or JMX lookup.getConnection()
will block indefinitely until resumePool() is called.@Deprecated public void resumePool()
HikariPoolMXBean#resumePool() method on the HikariPoolMXBean
obtained by #getHikariPoolMXBean() or JMX lookup.public void close()
close in interface AutoCloseableclose in interface Closeablepublic boolean isClosed()
@Deprecated public void shutdown()
close() insteadCopyright © 2017 Zaxxer.com. All Rights Reserved.