mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Encapsulate some more variables
Refactor Settings class a bit and move header straight to the file
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user