BuyNowHome buyHome; BuyNow     buy; Item       item; Collection buyList=null; int        quantity; String     html;
BuyNowHome   buyHome; BuyNow       buy; Item         item; Collection   buyList=null; int          quantity; StringBuffer html = new StringBuffer();
  public String listBoughtItems(Integer userId, ItemHome iHome)   {    BuyNowHome buyHome;    BuyNow     buy;    Item       item;    Collection buyList=null;    int        quantity;    String     html;    // Get the list of items the user bought    try     {      buyHome = (BuyNowHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/BuyNow"),                                                        BuyNowHome.class);    }     catch (Exception e)    {      throw new EJBException("Cannot lookup BuyNow: " +e+"<br>");    }    try     {      buyList = buyHome.findUserBuyNow(userId);    }    catch (Exception e)    {      throw new EJBException("Exception getting item list (buy now): " +e+"<br>");    }    if ((buyList == null) || (buyList.isEmpty()))    {      html = "<br>";      html = html.concat("<h3>You didn't buy any item in the last 30 days.</h3>");      html = html.concat("<br>");      return html;    }    html = printUserBoughtItemHeader();        Iterator it = buyList.iterator();    while (it.hasNext())     {      // Get the name of the items      try      {        buy = (BuyNow)it.next();	quantity = buy.getQuantity();      }      catch (Exception e)       {        throw new EJBException("Exception getting buyNow quantity: " + e +"<br>");      }      try      {	item = iHome.findByPrimaryKey(new ItemPK(buy.getItemId()));        // display information about the item        html = html.concat(item.printUserBoughtItem(quantity));      }      catch (Exception e)       {        throw new EJBException("Exception getting item: " + e +"<br>");      }    }    html = html.concat(printItemFooter());    return html;  }