Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } else if (splitted[0].equals("!disband")) {
- if (splitted.length != 2) {
- mc.dropMessage("!disband <Guild Name>");
- } else {
- if (PreparedStatement ps = con.prepareStatement("SELECT * FROM `guilds` WHERE `name` = ?") {
- try {
- Connection con = DatabaseConnection.getConnection();
- PreparedStatement ps = con.prepareStatement("DELETE from `guilds` WHERE name = ?");
- ps.setString(1, splitted[1]);
- ps.executeUpdate();
- ps.close();
- mc.dropMessage(splitted[1] + " has been disbanded");
- } else {
- mc.dropMessage("Guild name does not exist.");
- } catch (SQLException e) {
- mc.dropMessage("SQL Exception");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment