Use the RecordIOManager bean to retrieve records from a database
or to add, update, or delete records.
With RecordIOManager, you can
do the following:
- Open and close a database file.
- Access the records in an iSeries physical or logical file sequentially
(by record number or by key). If you specify sequential file access when you
open the file, records are retrieved in sequential order, and methods that
require key parameters, such as readAllRecordsEqual(String[]) or readRecord(String[]),
are ignored.
Note: RecordIOManager lets you manipulate the data of a particular record
format of a database file (a physical or logical file), using iSeries record
level access. However, adding, updating, or deleting a record in a logical
file is prohibited; only data retrieval is allowed in a logical file.
- Join database files for joined file access.
Note: RecordIOManager uses the IBM Toolbox record-level access classes,
which do not support logical join files or null key fields.
- Each standalone RecordIOManager object can manipulate data from only one
record format of a database file. When you require access to multiple record
formats or database files, define multiple instances of RecordIOManager, or
join two instances of RecordIOManager to access only records that have common
values in the foreign keys.
To join two database files, use the joinDatabase(String[] foreignKeys,
RecordIOManager database) method. Both database files must have the FILEACCESS_KEYED
file access type.
- Specify conditions for filtering records on any fields.
- Write sequential records to a database file.
- Update or delete records in a database file by record numbers. You can
use different read methods to determine record numbers.
- Position the cursor of a file at a desired location.
RecordIOManager supports the usual security and control capabilities
of database management. You can do the following:
- Lock a database file.
- Use commitment control when accessing a database file.
- Commit and roll back transactions for a connection.
- Start and end a journal physical file.
- Set filter conditions on records that can be accessed.
If you want to filter records in a database, you can define your own
check condition class. This check condition class must extend AbstractCondition
and implement the isConditionValid(com.ibm.as400.access.Record record)
method, which returns a boolean value to determine if the record can
be accessed. If the return value is true, then the record can
be accessed. Otherwise, the record will be skipped.