public List<SelectItem> getmenuItemsLocation() {

        List<SelectItem> menuItemsLocation = new ArrayList<SelectItem>() {
            private static final long serialVersionUID = 3109256773218160485L;

            {
                try {
                    //Connect to database

                    conn = DriverManager.getConnection(url, userName, password);

                    stmt = conn.createStatement();

                    ResultSet rset = null;

                    PreparedStatement pstmt = null;

                    pstmt = conn.prepareStatement("select distinct location from Course order by location asc");

                    rset = pstmt.executeQuery();

                    while (rset.next()) {
                        add(new SelectItem(rset.getString("location")));
                    }

                } catch (SQLException e) {
                    response = "SQLException: " + e.getMessage();
                    while ((e = e.getNextException()) != null) {
                        response = e.getMessage();
                    }
                } finally {
                    try {
                        if (stmt != null) {
                            stmt.close();
                        }
                        if (conn != null) {
                            conn.close();
                        }
                    } catch (SQLException e) {
                        response = "SQLException: " + e.getMessage();
                        while ((e = e.getNextException()) != null) {
                            response = e.getMessage();
                        }
                    }
                }
            }
        };
        return menuItemsLocation;
    }