Skip to content

Commit 170fca3

Browse files
committed
fix: Add missing update execution
1 parent 39ae187 commit 170fca3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
group = io.github.4drian3d
2-
version = 1.0.1
2+
version = 1.0.2-SNAPSHOT
33
description = LastServer Addon for AuthMeVelocity

src/main/java/io/github/_4drian3d/authmevelocity/lastserver/database/Database.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
@Singleton
1919
public final class Database {
2020
private static final String CREATE_SENTENCE = """
21-
CREATE TABLE IF NOT EXISTS last_server\
22-
(\
21+
CREATE TABLE IF NOT EXISTS last_server(\
2322
`player` VARCHAR(20) NOT NULL PRIMARY KEY, \
2423
`server` VARCHAR(20) NOT NULL\
2524
);
@@ -62,17 +61,18 @@ public String lastServerOf(final String playerName) {
6261

6362
public void setLastServer(final String playerName, final String server) {
6463
try (final Connection connection = this.source.getConnection();
65-
final PreparedStatement statement = connection.prepareStatement(INSERT_DATA);
64+
final PreparedStatement statement = connection.prepareStatement(INSERT_DATA)
6665
) {
6766
statement.setString(1, playerName);
6867
statement.setString(2, server);
6968
statement.executeUpdate();
7069
} catch (final SQLException e) {
7170
try (final Connection connection = this.source.getConnection();
72-
final PreparedStatement statement = connection.prepareStatement(UPDATE_SERVER);
71+
final PreparedStatement statement = connection.prepareStatement(UPDATE_SERVER)
7372
) {
7473
statement.setString(1, server);
7574
statement.setString(2, playerName);
75+
statement.executeUpdate();
7676
} catch (SQLException ex) {
7777
this.logger.warn("An error occurred updating last server information of player {}", playerName, ex);
7878
}

0 commit comments

Comments
 (0)