Record-level access
The record-level access classes provide the ability to do the
following:
- Create an iSeries 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 an iSeries physical or logical file, or
the record formats from an iSeries 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 iSeries file sequentially, by record number, or
by key.
- Write records to an iSeries file.
- Update records in an iSeries file sequentially, by record number, or by
key.
- Delete records in an iSeries file sequentially, by record number, or by
key.
- Lock an iSeries 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 iSeries files.
- Delete a member from an iSeries 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 an iSeries file
whose access is by key.
- The SequentialFile class represents an iSeries
file whose access is by record number.
- The AS400FileRecordDescription class provides
the methods for retrieving the record format of an iSeries 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 iSeries. See
managing connections for information about managing connections.
The record-level access classes require the integrated file
system path name of the data base file. See
integrated file system path names for more information.
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
These classes are described in the data
conversion section.
Examples