From 9be60ca920b814f3640160cf56ef39a7dfa0c4b3 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Mon, 29 Apr 2019 18:32:58 +0800 Subject: [PATCH] Fix failed execute SQL make shop reappear when run /qs reload Former-commit-id: 5188cc4d7ad1a4e98f103ab262642ca60322c2da [formerly 15012cd4c8fd024791d728d9a130d62ed6aaa628] Former-commit-id: a5a55ae7580820655f0b39e5cd6c3e265c987f0c --- .../maxgamer/quickshop/Database/DatabaseHelper.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java index 60fd8f3f2..55137abe5 100644 --- a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java +++ b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java @@ -78,22 +78,14 @@ public class DatabaseHelper { return ps.executeQuery(); } - public static ResultSet removeShop(Database db, int x, int y, int z, String worldName) throws SQLException { + public static void removeShop(Database db, int x, int y, int z, String worldName) throws SQLException { // db.getConnection().createStatement() // .executeUpdate("DELETE FROM " + QuickShop.instance.getDbPrefix() + "shops WHERE x = " + x + " AND y = " + y // + " AND z = " + z + " AND world = \"" + worldName + "\"" // + (db.getCore() instanceof MySQLCore ? " LIMIT 1" : "")); String sqlString = "DELETE FROM "+QuickShop.instance.getDbPrefix()+"shops WHERE x = '"+x+"' AND y = '"+y+"' AND z ='"+z+"' AND world = '"+worldName+"'"+(db.getCore() instanceof MySQLCore ? " LIMIT 1" : ""); - PreparedStatement ps = db.getConnection().prepareStatement(sqlString); - // PreparedStatement ps = db.getConnection().prepareStatement() -// -// -// -// // -// + (db.getCore() instanceof MySQLCore ? " LIMIT 1" : "")); - //"DELETE FROM shops WHERE x = '" + x + "' AND y = '" + y + "' AND z = '" + z + "' AND world = '" + world + "'" - return ps.executeQuery(); + db.execute(sqlString); } public static void updateOwner2UUID(String ownerUUID, int x, int y, int z, String worldName) throws SQLException { QuickShop.instance.getDB().getConnection().createStatement()