Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void getMutes()
- {
- new BukkitRunnable()
- {
- @Override
- public void run()
- {
- Connection connection = MySQL.getConnection();
- PreparedStatement preparedStatement = null;
- ResultSet rs = null;
- try
- {
- preparedStatement = connection.prepareStatement("SELECT * FROM `punishments` WHERE `id` = ? AND `type` = ? ORDER BY `start` DESC LIMIT 1;");
- preparedStatement.setString(1, uuid.toString());
- preparedStatement.setString(2, PunishmentType.MUTE.toString());
- preparedStatement.executeQuery();
- rs = preparedStatement.getResultSet();
- if(rs.isBeforeFirst())
- {
- while (rs.next())
- {
- mute = rs.getLong("end");
- }
- }
- } catch (SQLException e)
- {
- e.printStackTrace();
- }
- finally
- {
- try
- {
- assert rs != null;
- rs.close();
- preparedStatement.close();
- } catch (SQLException e)
- {
- e.printStackTrace();
- }
- }
- }
- }.runTaskAsynchronously(core);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement