Skip to content

Commit

Permalink
Corrected index of statement placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyzards committed May 26, 2022
1 parent 5d44663 commit 82873ea
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class CoreEventListener {
*/
@Subscribe
public void onServerConnect(ServerConnectedEvent event) {
VelocityPlugin.getInstance().getServer().sendMessage(Component.text("SERVER CONNECTION EVENT FIRED FOR: " + event.getPlayer().getUsername()));

try {
Connection connection = VelocityPlugin.getInstance().getMySQL().getConnection();
PreparedStatement statement = connection.prepareStatement("""
Expand All @@ -38,9 +36,9 @@ public void onServerConnect(ServerConnectedEvent event) {
ON DUPLICATE KEY UPDATE
username = ?;
""");
statement.setString(0, event.getPlayer().getUniqueId().toString());
statement.setString(1, event.getPlayer().getUsername());
statement.setString(1, event.getPlayer().getUniqueId().toString());
statement.setString(2, event.getPlayer().getUsername());
statement.setString(3, event.getPlayer().getUsername());
statement.executeUpdate();
statement.close();
connection.close();
Expand Down

0 comments on commit 82873ea

Please sign in to comment.