Finding Bids (cont)
  • Example 17 shows the code for finding all bids on a particular item
  • Note that the return type is java.util.Enumeration
    • The contents of the enumeration are the primary keys for the Bids found in the method
    • The primary keys are accumulated in a vector since there is no implementation of Enumeration that permits construction of the enumerated set
  • The code consists of two main parts:
    • Construct a query that retrieves rows from the Bid table
      • The primary key of the given Item is used to form the where clause of the query
    • Transfer primary key data from the results of the query to the vector
  • At the end, the elements() method of the vector allows an Enumeration of the keys to be easily returned

Next Slide >>