Encapsulate some more variables

Refactor Settings class a bit and move header straight to the file
This commit is contained in:
Daniil Z committed 2021-03-01 19:27:01 +03:00
1 parent ca0ac7c13e
commit b05a5bfb8d
30 files changed
+248 -255

No files matched your search

@@ -26,11 +26,11 @@ public class SQL extends Database {
// Initialise connection via mySQL
private void getMySQLConnection() {
String host = HuskHomes.settings.getMySQLhost();
int port = HuskHomes.settings.getMySQLport();
String database = HuskHomes.settings.getMySQLdatabase();
String username = HuskHomes.settings.getMySQLusername();
String password = HuskHomes.settings.getMySQLpassword();
String host = HuskHomes.getSettings().getMySQLhost();
int port = HuskHomes.getSettings().getMySQLport();
String database = HuskHomes.getSettings().getMySQLdatabase();
String username = HuskHomes.getSettings().getMySQLusername();
String password = HuskHomes.getSettings().getMySQLpassword();
try {
synchronized (HuskHomes.getInstance()) {
@@ -70,7 +70,7 @@ public class SQL extends Database {
public Connection getSQLConnection() {
try {
if (connection == null || connection.isClosed()) {
String dataStorageType = HuskHomes.settings.getStorageType().toLowerCase();
String dataStorageType = HuskHomes.getSettings().getStorageType().toLowerCase();
switch (dataStorageType) {
case "mysql":
getMySQLConnection();