public static List<Pledge> readAllFrequencyunit(Connection connection, Enum_version version, Pledge.Enum_frequency_unit frequency_unit) {
        PreparedStatement statement;
        ResultSet resultset;
        List<Pledge> pledgelist = new ArrayList();
        Calendar calendar = Calendar.getInstance();
        String frequency = "";
        try {
            statement = connection.prepareStatement("select * from civicrm_pledge where frequency_unit = ?");
            switch (frequency_unit) {
                case DAY:
                    frequency = Pledge.FREQUENCY_UNIT_DAY;
                    break;
                case WEEK:
                    frequency = Pledge.FREQUENCY_UNIT_WEEK;
                    break;
                case MONTH:
                    frequency = Pledge.FREQUENCY_UNIT_MONTH;
                    break;
                case QUARTER:
                    frequency = Pledge.FREQUENCY_UNIT_QUARTER;
                    break;
                case SEMESTER:
                    frequency = Pledge.FREQUENCY_UNIT_SEMESTER;
                    break;
                case YEAR:
                    frequency = Pledge.FREQUENCY_UNIT_YEAR;
                    break;
            }
            statement.setString(1, frequency);
            resultset = statement.executeQuery();
            while (resultset.next()) {
                pledgelist.add(setPledge(version, resultset));
            }
            return pledgelist;
        } catch (SQLException ex) {
            Logger.getLogger(PledgeController.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (Exception e) {
            Logger.getLogger(PledgeController.class.getName()).log(Level.SEVERE, null, e);
            return null;
        }
    }