public void searchRecommendedFlights() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            System.out.println("Where is your MySQL JDBC Driver?");
            e.printStackTrace();

        }
        PreparedStatement ps = null;
        Connection con = null;
        ResultSet rs;
        try {

            con = DriverManager.getConnection("jdbc:mysql://mysql2.cs.stonybrook.edu:3306/mlavina", "mlavina", "108262940");
            if (con != null) {
                con.setAutoCommit(false);
                String sql = "CREATE OR Replace VIEW FlightReservation(AirlineID, FlightNo, ResrCount) \n"
                        + "AS \n"
                        + "SELECT I.AirlineID, I.FlightNo, COUNT(DISTINCT I.ResrNo) \n"
                        + "FROM Includes I \n"
                        + "GROUP BY I.AirlineID, I.FlightNo";

                ps = con.prepareStatement(sql);

                ps.execute();
                try {
                    sql = "SELECT * FROM FlightReservation FR \n"
                            + "WHERE NOT EXISTS ( \n"
                            + " SELECT * FROM Reservation R, Includes I \n"
                            + " WHERE R.ResrNo = I.ResrNo AND FR.AirlineID = I.AirlineID \n"
                            + " AND FR.FlightNo = I.FlightNo AND R.AccountNo = ?) \n"
                            + "ORDER BY FR.ResrCount DESC";
                    ps = con.prepareStatement(sql);
                    ps.setInt(1, accountNo);
                    ps.execute();

                    rs = ps.getResultSet();
                    recommendFlights.removeAll(recommendFlights);
                    while (rs.next()) {
                        //flightResults.add()
                        recommendFlights.add(new Flight(rs.getString("AirlineID"), rs.getInt("FlightNo")));
                    }
                    con.commit();
                } catch (Exception e) {
                    con.rollback();
                }
            }

        } catch (Exception e) {
            System.out.println(e);
        } finally {
            try {
                con.setAutoCommit(true);
                con.close();
                ps.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }