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 ConnectionConfig
credentials
-
Constructor Summary
Constructors Constructor Description HikariConnectionFactory(ConnectionConfig credentials)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendConfigurationInfo(com.zaxxer.hikari.HikariConfig config)
protected void
appendProperties(com.zaxxer.hikari.HikariConfig config, Map<String,String> properties)
void
close()
Closes the connection factory, closing all the alive connectionsvoid
connect()
Connects to the remote server.Connection
getConnection()
Retrieves connection to the connected remote server / file.protected String
getDriverClass()
-
-
-
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:SQLConnectionFactory
Connects to the remote server.- Specified by:
connect
in interfaceSQLConnectionFactory
-
getConnection
public Connection getConnection() throws SQLException
Description copied from interface:SQLConnectionFactory
Retrieves connection to the connected remote server / file.- Specified by:
getConnection
in interfaceSQLConnectionFactory
- Returns:
- connection
- Throws:
SQLException
- if something wrong occurs
-
close
public void close()
Description copied from interface:SQLConnectionFactory
Closes the connection factory, closing all the alive connections- Specified by:
close
in interfaceSQLConnectionFactory
-
-