@Override public boolean deleteAllMessagesMarkedforDeletion() { try { conn.commit(); unlockMaildrop(); } catch (SQLException e) { printSQLException(e); rollbackCommit(); closeConnection(); return false; } closeConnection(); return true; }
@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); } }
@Override public void unmarkAllMessagesMarkedForDeletion() { rollbackCommit(); }