public static List  getAppointments(Mailbox mbox, long start, long end, int folderId)
public static List  getAppointments(Mailbox mbox, long start, long end, int folderId, int[] excludeFolderIds)
    public static List /* Appointment */ getAppointments(Mailbox mbox, long start, long end, int folderId)         throws ServiceException    {        Connection conn = mbox.getOperationConnection();        PreparedStatement stmt = null;        ResultSet rs = null;        try {            boolean folderSpecified = folderId != Mailbox.ID_AUTO_INCREMENT;            stmt = conn.prepareStatement("SELECT " + DB_FIELDS +                     " FROM " + getMailItemTableName(mbox.getId(), "mi") + ", " +                          getAppointmentTableName(mbox.getId(), " appt") +                     " WHERE mi.type = " + MailItem.TYPE_APPOINTMENT +                     " AND mi.id = appt.item_id" +                     " AND appt.start_time < ? AND appt.end_time > ?" +                     (folderSpecified ? " AND folder_id = ?" : "") +                     " GROUP BY mi.id");            stmt.setTimestamp(1, new Timestamp(end));            stmt.setTimestamp(2, new Timestamp(start));            if (folderSpecified)                stmt.setInt(3, folderId);            rs = stmt.executeQuery();            List /* UnderlyingData */ result = new ArrayList();            while (rs.next())                result.add(constructItem(rs));            return result;        } catch (SQLException e) {            throw ServiceException.FAILURE("fetching appointments for mailbox " + mbox.getId(), e);        } finally {            DbPool.closeResults(rs);            DbPool.closeStatement(stmt);        }    }