Class HikariConnectionFactory
- java.lang.Object
-
- com.mrivanplays.sqlhelper.connection.implementation.HikariConnectionFactory
-
- All Implemented Interfaces:
SQLConnectionFactory
- Direct Known Subclasses:
MariaDBConnectionFactory,MySQLConnectionFactory,PostgreSQLConnectionFactory
public abstract class HikariConnectionFactory extends Object implements SQLConnectionFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionConfigcredentials
-
Constructor Summary
Constructors Constructor Description HikariConnectionFactory(ConnectionConfig credentials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendConfigurationInfo(com.zaxxer.hikari.HikariConfig config)protected voidappendProperties(com.zaxxer.hikari.HikariConfig config, Map<String,String> properties)voidclose()Closes the connection factory, closing all the alive connectionsvoidconnect()Connects to the remote server.ConnectiongetConnection()Retrieves connection to the connected remote server / file.protected StringgetDriverClass()
-
-
-
Field Detail
-
credentials
protected ConnectionConfig credentials
-
-
Constructor Detail
-
HikariConnectionFactory
public HikariConnectionFactory(ConnectionConfig credentials)
-
-
Method Detail
-
getDriverClass
protected String getDriverClass()
-
appendProperties
protected void appendProperties(com.zaxxer.hikari.HikariConfig config, Map<String,String> properties)
-
appendConfigurationInfo
protected void appendConfigurationInfo(com.zaxxer.hikari.HikariConfig config)
-
connect
public void connect()
Description copied from interface:SQLConnectionFactoryConnects to the remote server.- Specified by:
connectin interfaceSQLConnectionFactory
-
getConnection
public Connection getConnection() throws SQLException
Description copied from interface:SQLConnectionFactoryRetrieves connection to the connected remote server / file.- Specified by:
getConnectionin interfaceSQLConnectionFactory- Returns:
- connection
- Throws:
SQLException- if something wrong occurs
-
close
public void close()
Description copied from interface:SQLConnectionFactoryCloses the connection factory, closing all the alive connections- Specified by:
closein interfaceSQLConnectionFactory
-
-