Loading State from the DB
  • Example 12 shows the source code for loading a Bid's state from the DB
  • This routine is actually called from a wrapper function
    • Gets the DB connection
    • Sets up a java.sql.Statement for use by code
    • Catches exceptions and cleans up
  • DB table definition for Bid
    • One bid represented by one row in the Bid table
    • Columns for:
      • Primary key - owner id & owned id
      • Item - primary key fields from item
      • Business data - amount & time

Next Slide >>