e {
      int ecode = bdb.ecode();
      System.err.println("get error: " + bdb.errmsg(ecode));
    }

    // traverse records
    BDBCUR cur = new BDBCUR(bdb);
    cur.first();
    String key;
    while((key = cur.key2()) != null){
      value = cur.val2();
      if(value != null){
        System.out.println(key + ":" + value);
      }
      cur.next();
    }

    // close the database
    if(!bdb.close()){
      int ecode = bdb.ecode();
      System.err.println("close error: " + bdb.errmsg(ecode));
    }
