1package com.runehive.game.service;
3import com.runehive.Config;
4import com.zaxxer.hikari.HikariConfig;
5import com.zaxxer.hikari.HikariDataSource;
6import org.apache.logging.log4j.LogManager;
7import org.apache.logging.log4j.Logger;
9import java.sql.Connection;
10import java.sql.SQLException;
18 public static void start() throws Exception {
19 HikariConfig config =
new HikariConfig();
20 config.setDriverClassName(
"com.mysql.jdbc.Driver");
24 config.setMaximumPoolSize(10);
25 config.setConnectionTimeout(5_000);
26 config.setIdleTimeout(0);
27 config.setMaxLifetime(0);
28 config.addDataSourceProperty(
"cachePrepStmts",
"true");
30 logger.info(
"Successfully connected to forum database.");
The class that contains setting-related constants for the server.
static final String FORUM_DB_PASS
This is used for mySQL to authenticate username and passwords from the forum.
static final String FORUM_DB_URL
This is used for mySQL to authenticate username and passwords from the forum.
static final String FORUM_DB_USER
This is used for mySQL to authenticate username and passwords from the forum.
static Connection getConnection()
static HikariDataSource getConnectionPool()
static final Logger logger
static HikariDataSource connectionPool