From 5d7948ff89ad09c3005ffeb866070c84c9cf972a Mon Sep 17 00:00:00 2001 From: games647 Date: Sun, 1 Jan 2017 18:53:41 +0100 Subject: [PATCH] Fix insert indexes (Fixes #167) --- .../scoreboardstats/pvpstats/Database.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java b/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java index 8a00dbae..1cd51cd9 100644 --- a/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java +++ b/src/main/java/com/github/games647/scoreboardstats/pvpstats/Database.java @@ -243,13 +243,15 @@ private void insert(List stats) { + "(?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS); for (PlayerStats stat : stats) { - stmt.setInt(1, stat.getKills()); - stmt.setInt(2, stat.getDeaths()); - stmt.setInt(3, stat.getKillstreak()); - stmt.setInt(4, stat.getMobkills()); + stmt.setString(1, stat.getUuid() == null ? null : stat.getUuid().toString()); + stmt.setString(2, stat.getPlayername()); - stmt.setLong(5, stat.getLastOnline()); - stmt.setString(6, stat.getPlayername()); + stmt.setInt(3, stat.getKills()); + stmt.setInt(4, stat.getDeaths()); + stmt.setInt(5, stat.getKillstreak()); + stmt.setInt(6, stat.getMobkills()); + + stmt.setLong(7, stat.getLastOnline()); stmt.addBatch(); }