public class HikariConnectionProvider extends java.lang.Object implements ConnectionProvider
| Constructor and Description |
|---|
HikariConnectionProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeAll()
Close all resources.
|
void |
closeDataSource(DbConfig dbConfig)
Close the data source from which connections are made.
|
java.sql.Connection |
getConnection(DbConfig dbConfig)
Provides a JDBC connection configured with the provided DbConfing.
|
java.sql.Connection |
getConnection(java.lang.String configName,
java.lang.Class<?> classContext)
|
public java.sql.Connection getConnection(java.lang.String configName,
java.lang.Class<?> classContext)
ConnectionProviderconfigName DbConfig and optional classContext.
A standard implementation sources the configName DbConfig in the following order:
DbConfigProvider implementations<configName>.dbconfig file in the /config subdir of the current directory (runtime only)<configName>.dbconfig file in the current directory (runtime only)<configName>.dbconfig resource file in the <module-name>.config package (JDK 11+)<configName>.dbconfig resource file in the config package (JDK 8+)getConnection in interface ConnectionProviderconfigName - The name of the DbConfig. Does not include a file extension.classContext - The class initiating the connection. Used for context when searching for the DbConfig as a resource
file.public java.sql.Connection getConnection(DbConfig dbConfig) throws java.sql.SQLException
ConnectionProvidergetConnection in interface ConnectionProviderdbConfig - The configuration for the connectionjava.sql.SQLExceptionpublic void closeDataSource(DbConfig dbConfig)
ConnectionProvidercloseDataSource in interface ConnectionProviderdbConfig - The DbConfig corresponding with the data source.public void closeAll()
ConnectionProvidercloseAll in interface ConnectionProviderCopyright © 2023. All rights reserved.