mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Tweak connection parameters
This commit is contained in:
1 parent
649d4c0600
commit
201c77ec4b
2 files changed
+6
-10
No files matched your search
@@ -54,7 +54,7 @@ public class Settings {
|
||||
public String mySqlPassword = "pa55w0rd";
|
||||
|
||||
@KeyPath("database.mysql.credentials.parameters")
|
||||
public String mySqlConnectionParameters = "?useUnicode=true&characterEncoding=UTF-8&useSSL=false";
|
||||
public String mySqlConnectionParameters = "?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8";
|
||||
|
||||
@KeyPath("database.mysql.connection_pool")
|
||||
public ConnectionPoolOptions mySqlPoolOptions = new ConnectionPoolOptions();
|
||||
|
||||
@@ -647,8 +647,8 @@ public class MySqlDatabase extends Database {
|
||||
@Override
|
||||
public CompletableFuture<Void> setCurrentTeleport(@NotNull User user, @Nullable Teleport teleport) {
|
||||
return CompletableFuture.runAsync(() -> {
|
||||
// Clear the user's current teleport
|
||||
try (Connection connection = getConnection()) {
|
||||
// Clear the user's current teleport
|
||||
try (PreparedStatement deleteStatement = connection.prepareStatement(formatStatementTables("""
|
||||
DELETE FROM `%positions_table%`
|
||||
WHERE `id`=(
|
||||
@@ -659,13 +659,9 @@ public class MySqlDatabase extends Database {
|
||||
deleteStatement.setString(1, user.uuid.toString());
|
||||
deleteStatement.executeUpdate();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
getLogger().log(Level.SEVERE, "Failed to clear the current teleport of " + user.username, e);
|
||||
}
|
||||
|
||||
// Set the user's teleport into the database (if it's not null)
|
||||
if (teleport != null) {
|
||||
try (Connection connection = getConnection()) {
|
||||
// Set the user's teleport into the database (if it's not null)
|
||||
if (teleport != null) {
|
||||
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
|
||||
INSERT INTO `%teleports_table%` (`player_uuid`, `destination_id`, `type`)
|
||||
VALUES (?,?,?);"""))) {
|
||||
@@ -675,9 +671,9 @@ public class MySqlDatabase extends Database {
|
||||
|
||||
statement.executeUpdate();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
getLogger().log(Level.SEVERE, "Failed to set the current teleport of " + user.username, e);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
getLogger().log(Level.SEVERE, "Failed to clear the current teleport of " + user.username, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user