Package dev.king.universal.wrapper.mysql
Class PoolableConnection
java.lang.Object
dev.king.universal.wrapper.mysql.PoolableConnection
- All Implemented Interfaces:
PoolableProvider
- Direct Known Subclasses:
MysqlProvider
public class PoolableConnection extends java.lang.Object implements PoolableProvider
-
Constructor Summary
Constructors Constructor Description PoolableConnection()
-
Method Summary
Modifier and Type Method Description com.zaxxer.hikari.HikariDataSource
obtainDataSource(@NonNull UniversalCredential credentials, int maxConnections)
Get connection pool from hikari that offers more availability
-
Constructor Details
-
PoolableConnection
public PoolableConnection()
-
-
Method Details
-
obtainDataSource
public com.zaxxer.hikari.HikariDataSource obtainDataSource(@NonNull @NonNull UniversalCredential credentials, int maxConnections) throws java.sql.SQLExceptionGet connection pool from hikari that offers more availability- Specified by:
obtainDataSource
in interfacePoolableProvider
- Parameters:
credentials
- instance ofUniversalCredential
to login into mysqlmaxConnections
- passed in MysqlProvider constructor- Returns:
- data source
- Throws:
java.sql.SQLException
- if driver class doesn't exists
-