public class HikariDataSource extends HikariConfig implements DataSource
Constructor and Description |
---|
HikariDataSource()
Default constructor.
|
HikariDataSource(HikariConfig configuration)
Construct a HikariDataSource with the specified configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
close() and shutdown() are synonymous. |
void |
evictConnection(Connection connection)
Evict a connection from the pool.
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
shutdown()
Shutdown the DataSource and its associated pool.
|
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
addDataSourceProperty, getCatalog, getConnectionCustomizer, getConnectionCustomizerClassName, getConnectionInitSql, getConnectionTestQuery, getConnectionTimeout, getDataSource, getDataSourceClassName, getDataSourceJNDI, getDataSourceProperties, getIdleTimeout, getJdbcUrl, getLeakDetectionThreshold, getMaximumPoolSize, getMaxLifetime, getMetricsTrackerClassName, getMinimumIdle, getPassword, getPoolName, getTransactionIsolation, getUsername, isAutoCommit, isInitializationFailFast, isIsolateInternalQueries, isJdbc4ConnectionTest, isReadOnly, isRecordMetrics, isRegisterMbeans, setAutoCommit, setCatalog, setConnectionCustomizer, setConnectionCustomizerClassName, setConnectionInitSql, setConnectionTestQuery, setConnectionTimeout, setDataSource, setDataSourceClassName, setDataSourceJNDI, setDataSourceProperties, setDriverClassName, setIdleTimeout, setInitializationFailFast, setIsolateInternalQueries, setJdbc4ConnectionTest, setJdbcUrl, setLeakDetectionThreshold, setMaximumPoolSize, setMaxLifetime, setMetricsTrackerClassName, setMinimumIdle, setPassword, setPoolName, setReadOnly, setRecordMetrics, setRegisterMbeans, setTransactionIsolation, setUsername, validate
public 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 DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public void evictConnection(Connection connection)
connection
- the connection to evict from the poolpublic void close()
close()
and shutdown()
are synonymous.public void shutdown()
Copyright © 2014 Zaxxer.com. All rights reserved.