// if we have any results from the query set up the connection
// to the local Opportunity session EJB
InitialContext ctx = new InitialContext();
OpportunityLocalHome opportunityHome = (OpportunityLocalHome)ctx
.lookup("local/Opportunity");
OpportunityLocal opportunityBean = opportunityHome.create();
opportunityBean.setDataSource(dataSource);
// the iterate through the results of the query grabbing an
// OpportunityVO for each id.
Iterator i = result.iterator();
while (i.hasNext()) {
HashMap resultRow = (HashMap)i.next();
Number opportunityId = (Number)resultRow.get("oppId");
try {
OpportunityVO opportunity = opportunityBean.getOpportunity(individualId, opportunityId
.intValue());
opportunityList.add(opportunity);
} catch (AuthorizationFailedException afe) {
// no reason to completely fail here, it will just be one less thing
// on our list. dump it in the logs, because it is indicative of an