mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Minor improvements and tweaks
This commit is contained in:
1 parent
86d14f6018
commit
db9b8fa193
3 files changed
+9
-7
No files matched your search
@@ -8,6 +8,8 @@ import java.sql.SQLException;
|
||||
public abstract class Database {
|
||||
protected HuskHomes plugin;
|
||||
|
||||
public final static String DATA_POOL_NAME = "HuskHomesHikariPool";
|
||||
|
||||
public Database(HuskHomes instance) {
|
||||
plugin = instance;
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ public class MySQL extends Database {
|
||||
dataSource.setMaxLifetime(hikariMaximumLifetime);
|
||||
dataSource.setKeepaliveTime(hikariKeepAliveTime);
|
||||
dataSource.setConnectionTimeout(hikariConnectionTimeOut);
|
||||
dataSource.setPoolName("HuskHomesHikariPool");
|
||||
dataSource.setPoolName(DATA_POOL_NAME);
|
||||
|
||||
// Create tables
|
||||
try(Connection connection = dataSource.getConnection()) {
|
||||
try(Statement statement = connection.createStatement()) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
for (String tableCreationStatement : SQL_SETUP_STATEMENTS) {
|
||||
statement.execute(tableCreationStatement);
|
||||
}
|
||||
@@ -121,6 +121,6 @@ public class MySQL extends Database {
|
||||
|
||||
@Override
|
||||
public void backup() {
|
||||
plugin.getLogger().info("Remember to make backups of your HuskHomes Database before updating HuskHomes!");
|
||||
plugin.getLogger().info("Remember to make backups of your HuskHomes Database before updating the plugin!");
|
||||
}
|
||||
}
|
||||
@@ -115,11 +115,11 @@ public class SQLite extends Database {
|
||||
dataSource.setMaxLifetime(hikariMaximumLifetime);
|
||||
dataSource.setKeepaliveTime(hikariKeepAliveTime);
|
||||
dataSource.setConnectionTimeout(hikariConnectionTimeOut);
|
||||
dataSource.setPoolName("HuskHomesHikariPool");
|
||||
dataSource.setPoolName(DATA_POOL_NAME);
|
||||
|
||||
// Create tables
|
||||
try(Connection connection = dataSource.getConnection()) {
|
||||
try(Statement statement = connection.createStatement()) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
for (String tableCreationStatement : SQL_SETUP_STATEMENTS) {
|
||||
statement.execute(tableCreationStatement);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user