Collection result = cvdal.executeQuery();
if (result != null) {
// 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()) {