From 0a7db5e45efe81b2f824eeab37e10578cd53d4cd Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Tue, 4 Dec 2018 14:50:08 +0800 Subject: [PATCH] update Former-commit-id: 8b7bccc73c4917a42493014748f270fffa350242 [formerly 6168b1c997b386ac40a9153d3247b0a5176f30a5] Former-commit-id: 908c2e4d99e8fd175fcf3312e088f7c306801e8c --- .../maxgamer/quickshop/Database/DatabaseHelper.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java index 9ea7d7857..13bca3b11 100644 --- a/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java +++ b/src/main/java/org/maxgamer/quickshop/Database/DatabaseHelper.java @@ -58,14 +58,13 @@ public class DatabaseHelper { /** * Creates the database table 'messages' * - * @throws SQLException - * If the connection is invalid + * @throws SQLException If the connection is invalid */ public static void createMessagesTable(Database db) throws SQLException { Statement st = db.getConnection().createStatement(); String createTable = null; - createTable = "CREATE TABLE "+QuickShop.instance.dbPrefix+"messages (owner VARCHAR(255) NOT NULL, message TEXT(25) NOT NULL, time BIGINT(32) NOT NULL );"; - + createTable = "CREATE TABLE " + QuickShop.instance.dbPrefix + + "messages (owner VARCHAR(255) NOT NULL, message TEXT(25) NOT NULL, time BIGINT(32) NOT NULL );"; st.execute(createTable); } @@ -73,12 +72,10 @@ public class DatabaseHelper { PreparedStatement ps = db.getConnection() .prepareStatement("SELECT * FROM " + QuickShop.instance.dbPrefix + "shops"); return ps.executeQuery(); - } public static ResultSet selectAllMessages(Database db) throws SQLException { PreparedStatement ps = db.getConnection().prepareStatement("SELECT * FROM "+QuickShop.instance.dbPrefix+"messages"); return ps.executeQuery(); - } public static void removeShop(Database db, int x, int y, int z, String worldName) throws SQLException { @@ -92,7 +89,6 @@ public class DatabaseHelper { .executeUpdate("UPDATE "+QuickShop.instance.dbPrefix+"shops SET owner = \"" + ownerUUID.toString() + "\" WHERE x = " + x + " AND y = " + y + " AND z = " + z + " AND world = \"" + worldName + "\" LIMIT 1"); - } public static void updateShop(Database db, String owner, ItemStack item, int unlimited, int shopType,