Class MySQLManager
This class configures and manages a HikariCP connection pool dedicated to MySQL and wires the SQL-based progression loaders and savers used by the quest system.
Database connections, table initialization, and connection testing are performed during construction.
-
Field Summary
Fields inherited from class com.ordwen.odailyquests.quests.player.progression.storage.sql.SQLManager
hikariDataSource, loadProgressionSQL, saveProgressionSQL -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new MySQL manager and initializes the database layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes the HikariCP connection pool for MySQL.voidInitializes the database layer.Methods inherited from class com.ordwen.odailyquests.quests.player.progression.storage.sql.SQLManager
close, getConnection, getLoadProgressionSQL, getSaveProgressionSQL, setupTables, testConnection
-
Constructor Details
-
MySQLManager
public MySQLManager()Creates a new MySQL manager and initializes the database layer.This constructor: - instantiates SQL progression loaders and savers - initializes the HikariCP connection pool - tests the database connection - ensures required tables exist
-
-
Method Details
-
initHikariCP
public void initHikariCP()Initializes the HikariCP connection pool for MySQL.Pool settings such as maximum pool size, connection timeout, lifetime, and leak detection are configured here. The resulting data source is stored in the parent SQL manager.
-
setupDatabase
public void setupDatabase()Initializes the database layer.This method: - creates the HikariCP data source - validates the database connection - creates or updates required tables
-