From 607380e59c681fff26ff08b671ebd8b26bbbfad6 Mon Sep 17 00:00:00 2001 From: Xephi Date: Sat, 9 Jan 2016 21:30:13 +0100 Subject: [PATCH] Use PreparedStatement in all case needed it - #308 --- .../fr/xephi/authme/datasource/MySQL.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index 23781e2f7..d2ef3b1f5 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -627,15 +627,18 @@ public class MySQL implements DataSource { public synchronized List autoPurgeDatabase(long until) { List list = new ArrayList<>(); try (Connection con = getConnection()) { - String sql = "SELECT " + columnName + " FROM " + tableName + " WHERE " + columnLastLogin + "<" + until; - Statement st = con.createStatement(); - ResultSet rs = st.executeQuery(sql); + String sql = "SELECT " + columnName + " FROM " + tableName + " WHERE " + columnLastLogin + "