public void reserveOneWayTicket() {
        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 = "SELECT max(ResrNo) FROM reservation;";
                ps = con.prepareStatement(sql);

                try {
                    ps.execute();
                    rs = ps.getResultSet();
                    int resrNo = -1;

                    if (rs.next()) {
                        resrNo = rs.getInt(1) + 1;
                    }

                    sql = "Insert into passenger (Id, AccountNo) values (?,?) ON DUPLICATE KEY UPDATE Id=Id;";

                    ps = con.prepareStatement(sql);
                    ps.setInt(1, personID);
                    ps.setInt(2, accountNo);

                    ps.execute();

                    sql = "INSERT INTO Reservation VALUES (?, ?, ?, ?, ?,?); ";

                    ps = con.prepareStatement(sql);
                    ps.setInt(1, resrNo);
                    ps.setTimestamp(2, new java.sql.Timestamp(new Date().getTime()));
                    ps.setDouble(3, (selectedFlight.fare * .10));
                    ps.setDouble(4, selectedFlight.fare);
                    ps.setInt(5, employeeSSN);
                    ps.setInt(6, accountNo);

                    ps.execute();

                    sql = "INSERT INTO Includes VALUES (?, ?, ?, ?, ?);";

                    ps = con.prepareStatement(sql);

                    ps.setInt(1, resrNo);
                    ps.setString(2, selectedFlight.airlineID);
                    ps.setInt(3, selectedFlight.flightNo);
                    ps.setInt(4, selectedFlight.legNo);
                    ps.setDate(5, new java.sql.Date(selectedFlight.deptTime.getTime()));

                    ps.execute();

                    sql = "INSERT INTO ReservationPassenger VALUES(?, ?, ?, ?, ?, ?);";

                    ps = con.prepareStatement(sql);
                    ps.setInt(1, resrNo);
                    ps.setInt(2, personID);
                    ps.setInt(3, accountNo);
                    ps.setString(4, ("" + seatNo));
                    ps.setString(5, selectedFlight.seatClass);
                    ps.setString(6, mealPreference);

                    ps.execute();
                    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();
            }
        }
    }