Class DataBaseManager
java.lang.Object
net.joseplay.allianceutils.api.database.DataBaseManager
Handles MySQL connection pooling using HikariCP.
Responsible for initializing the datasource and managing connections.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the connection pool and releases resources.Retrieves a connection from the pool.
-
Constructor Details
-
DataBaseManager
Initializes database manager and starts connection pool.- Parameters:
host- Database hostport- Database portdatabase- Database nameuser- Database userpassword- Database password
-
-
Method Details
-
getConnection
Retrieves a connection from the pool.- Returns:
- Active SQL connection
- Throws:
SQLException- if connection cannot be obtained
-
disconnect
public void disconnect()Closes the connection pool and releases resources.
-