The record-level access classes create, read, update, and
delete IBM® i files
and members.
- Create a IBM i physical
file specifying one of the following:
- The record length
- An existing data description specifications (DDS) source file
- A RecordFormat object
- Retrieve the record format from a physical or logical file, or
the record formats from a IBM i multiple
format logical file.
Note: The record format of the file is not
retrieved in its entirety. The record formats retrieved are meant
to be used when setting the record format for an AS400File object.
Only enough information is retrieved to describe the contents of
a record of the file. Record format information, such as column headings
and aliases, is not retrieved.
- Access the records in an IBM i file sequentially,
by record number, or by key.
- Write records to a system file.
- Update records in a system file sequentially, by record number,
or by key.
- Delete records in a system file sequentially, by record number,
or by key.
- Lock a file for different types of access.
- Use commitment control to allow a Java™ program
to do the following:
- Start commitment control for the connection.
- Specify different commitment control lock levels for different
files.
- Commit and rollback transactions.
- Delete system files.
- Delete a member from a system file.
Note: The record-level access classes do not support logical
join files or null key fields.
The following classes perform these functions:
- The AS400File class is
the abstract base class for the record-level access classes. It provides
the methods for sequential record access, creation and deletion of
files and members, and commitment control activities.
- The KeyedFile class represents
a system file that has access by key.
- The SequentialFile class
represents a system file that has access by record number.
- The AS400FileRecordDescription class
provides the methods for retrieving the record format of a system
file.
The record-level access classes require an AS400 object that represents
the system that has the database files. Using the record-level access
classes causes the AS400 object to connect to the IBM i system.
See managing connections for
information about managing connections.
The record-level access classes use the following:
- The RecordFormat class
to describe a record of the database file
- The Record class to provide
access to the records of the database file
- The LineDataRecordWriter class
to write a record in line data format