Retrieving records

About this task

Several methods are available for retrieving records from the Electronic Journal. The returned records can be unformatted by sending the unformat(Hashtable aDataHashtable, Context aContext) message to the format object, which updates the data elements specified in the format definition within the operation context. The Journal service allows the application to do the following:

Procedure

  1. retrieveLastRecord - This method returns the last record, or null if the table is empty.
  2. retrieveLastRecords - This method returns a Vector with the last n records in descending order of record number (n is passed to the method as an argument).
  3. retrieveRecords - This method returns a Vector with all records that match the specified search string (passed as a method argument) in descending order of record number. This method can also accept as arguments a context and a Hashtable indexed collection format, and in this case this method unformats the retrieved records into the operation context as an indexed collection of keyed collections.
  4. retrieveRecord - This method returns the record with the record number specified as an argument, or null if the record does not exist.

Results

These methods return, by default, all the columns defined in the database table for the retrieved records. An additional argument can be passed to all the methods to specify which columns are to be retrieved.