public class HikariDataSource extends HikariConfig implements javax.sql.DataSource, java.io.Closeable
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(java.sql.Connection connection)
Evict a connection from the pool.
|
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password) |
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(java.io.PrintWriter out) |
void |
shutdown()
Shutdown the DataSource and its associated pool.
|
java.lang.String |
toString() |
<T> T |
unwrap(java.lang.Class<T> iface) |
addDataSourceProperty, getCatalog, getConnectionCustomizer, getConnectionCustomizerClassName, getConnectionInitSql, getConnectionTestQuery, getConnectionTimeout, getDataSource, getDataSourceClassName, getDataSourceJNDI, getDataSourceProperties, getIdleTimeout, getJdbcUrl, getLeakDetectionThreshold, getMaximumPoolSize, getMaxLifetime, getMetricsTrackerClassName, getMinimumIdle, getPassword, getPoolName, getThreadFactory, 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, setThreadFactory, 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 java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public void evictConnection(java.sql.Connection connection)
connection
- the connection to evict from the poolpublic void close()
close()
and shutdown()
are synonymous.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public void shutdown()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014 Zaxxer.com. All Rights Reserved.