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, getMetricRegistry, getMinimumIdle, getPassword, getPoolName, getThreadFactory, getTransactionIsolation, getUsername, isAutoCommit, isInitializationFailFast, isIsolateInternalQueries, isJdbc4ConnectionTest, isReadOnly, isRegisterMbeans, setAutoCommit, setCatalog, setConnectionCustomizer, setConnectionCustomizerClassName, setConnectionInitSql, setConnectionTestQuery, setConnectionTimeout, setDataSource, setDataSourceClassName, setDataSourceJNDI, setDataSourceProperties, setDriverClassName, setIdleTimeout, setInitializationFailFast, setIsolateInternalQueries, setJdbc4ConnectionTest, setJdbcUrl, setLeakDetectionThreshold, setMaximumPoolSize, setMaxLifetime, setMetricRegistry, setMinimumIdle, setPassword, setPoolName, setReadOnly, setRegisterMbeans, setThreadFactory, setTransactionIsolation, setUsername, 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 java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.io.PrintWriter getLogWriter()
throws java.sql.SQLException
getLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLogWriter(java.io.PrintWriter out)
throws java.sql.SQLException
setLogWriter in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic void setLoginTimeout(int seconds)
throws java.sql.SQLException
setLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic int getLoginTimeout()
throws java.sql.SQLException
getLoginTimeout in interface javax.sql.CommonDataSourcejava.sql.SQLExceptionpublic java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic 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.Closeableclose in interface java.lang.AutoCloseablepublic void shutdown()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014 Zaxxer.com. All Rights Reserved.