String      html = ""; ItemHome    iHome; Item        item; Query       query; QueryHome   qHome; BidHome     bidHome; Bid         bid; Enumeration bidList=null;
StringBuffer html; ItemHome     iHome; Item         item; Query        query; QueryHome    qHome; BidHome      bidHome; Bid          bid; Enumeration  bidList=null;
  public String getBidHistory(Integer itemId)   {    String      html = "";    ItemHome    iHome;    Item        item;    Query       query;    QueryHome   qHome;    BidHome     bidHome;    Bid         bid;    Enumeration bidList=null;    try    {      qHome = (QueryHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/Query"), QueryHome.class);      query = qHome.create();    }     catch (Exception e)    {      throw new EJBException("Cannot lookup Query: " +e);    }    try     {      iHome = (ItemHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/Item"), ItemHome.class);      item = iHome.findByPrimaryKey(new ItemPK(itemId));      html = "<center><h3>Bid History for "+item.getName()+"<br></h3></center>";    }     catch (Exception e)    {      throw new EJBException("Cannot lookup Item: " +e);    }    try     {      query = qHome.create();      bidList = query.getItemBidHistory(itemId).elements();    }    catch (Exception e)    {	throw new EJBException("Exception getting bids list: " +e+"<br>");    }    if ((bidList == null) || (!bidList.hasMoreElements()))    {      html = html.concat("<h3>There is no bid corresponding to this item.</h3><br>");      return html;    }    // Lookup bid home interface    try     {      bidHome = (BidHome)PortableRemoteObject.narrow(initialContext.lookup("java:comp/env/ejb/Bid"),                                                     BidHome.class);    }     catch (Exception e)    {      throw new EJBException("Cannot lookup Bid: " +e+"<br>");    }    try    {      html = html.concat(printBidHistoryHeader());      while (bidList.hasMoreElements())       {        // Get the bids          bid = bidHome.findByPrimaryKey((BidPK)bidList.nextElement());          html = html.concat(bid.printBidHistory());      }      html = html.concat(printBidHistoryFooter());    }    catch (Exception e)    {      throw new EJBException("Exception getting bid: " + e +"<br>");    }    return html;  }