Guest User

Untitled

a guest
Oct 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. } else if (splitted[0].equals("!disband")) {
  2.             if (splitted.length != 2) {
  3.                 mc.dropMessage("!disband <Guild Name>");
  4.             } else {
  5.                 if (PreparedStatement ps = con.prepareStatement("SELECT * FROM `guilds` WHERE `name` = ?") {
  6.                 try {
  7.                     Connection con = DatabaseConnection.getConnection();
  8.                     PreparedStatement ps = con.prepareStatement("DELETE from `guilds` WHERE name = ?");
  9.                     ps.setString(1, splitted[1]);
  10.                     ps.executeUpdate();
  11.                     ps.close();
  12.                     mc.dropMessage(splitted[1] + " has been disbanded");
  13.             } else {
  14.                 mc.dropMessage("Guild name does not exist.");
  15.                 } catch (SQLException e) {
  16.                     mc.dropMessage("SQL Exception");
  17.                     }
  18.                 }
  19.             }
  20.         }
Add Comment
Please, Sign In to add comment