Class MariaDBConnectionPool
java.lang.Object
com.zetaplugins.lifestealz.storage.connectionPool.MariaDBConnectionPool
- All Implemented Interfaces:
ConnectionPool
A MariaDB connection pool that manages connections to a MariaDB database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a connection to the MariaDB database from the connection pool.voidreleaseConnection(Connection connection) Releases a connection back to the MariaDB connection pool.voidshutdown()Shuts down the MariaDB connection pool and releases all resources.
-
Constructor Details
-
MariaDBConnectionPool
public MariaDBConnectionPool(String host, String port, String database, String username, String password) Constructs a MariaDB connection pool with the specified host, port, database, username, and password.- Parameters:
host- the host of the MariaDB databaseport- the port of the MariaDB databasedatabase- the name of the MariaDB databaseusername- the username to connect to the MariaDB databasepassword- the password to connect to the MariaDB database
-
-
Method Details
-
getConnection
Returns a connection to the MariaDB database from the connection pool.- Specified by:
getConnectionin interfaceConnectionPool- Returns:
- a connection to the MariaDB database
- Throws:
SQLException- if an error occurs while getting a connection
-
releaseConnection
Releases a connection back to the MariaDB connection pool.- Specified by:
releaseConnectionin interfaceConnectionPool- Parameters:
connection- the connection to release- Throws:
SQLException- if an error occurs while releasing the connection
-
shutdown
public void shutdown()Shuts down the MariaDB connection pool and releases all resources.- Specified by:
shutdownin interfaceConnectionPool
-