Example #1
0
  @Override
  public boolean deleteAllMessagesMarkedforDeletion() {

    try {

      conn.commit();
      unlockMaildrop();

    } catch (SQLException e) {
      printSQLException(e);
      rollbackCommit();
      closeConnection();
      return false;
    }

    closeConnection();
    return true;
  }
Example #2
0
  @Override
  public void markMessageForDeletion(int messageNumber) {

    String mailIDQuery = "SELECT iMailID FROM m_Mail WHERE iMaildropID=" + seissionUserID + ";";

    try (Statement statement = conn.createStatement()) {

      ResultSet rs = statement.executeQuery(mailIDQuery);
      rs.absolute(messageNumber);

      String deleteQuery =
          "DELETE FROM m_MAil WHERE iMaildropID="
              + seissionUserID
              + " AND "
              + "iMAilID="
              + rs.getInt("iMailID")
              + ";";
      statement.executeUpdate(deleteQuery);

    } catch (SQLException e) {
      rollbackCommit();
      printSQLException(e);
    }
  }
Example #3
0
 @Override
 public void unmarkAllMessagesMarkedForDeletion() {
   rollbackCommit();
 }