Record-level access
Record-level access supports both Java programs and Java applets
when the programs and applets are running on an AS/400 system that
is at Version 4 Release 2 (V4R2) or later.
The record-level access classes provide the ability to do the
following:
- Create an AS/400 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 AS/400 physical or logical
file, or the record formats from an AS/400 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 AS/400 file sequentially, by record
number, or by key.
- Write records to an AS/400 file.
- Update records in an AS/400 file sequentially, by record
number, or by key.
- Delete records in an AS/400 file sequentially, by record
number, or by key.
- Lock an AS/400 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 AS/400 files.
- Delete a member from an AS/400 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
AS/400 file whose access is by key.
- The SequentialFile class represents an
AS/400 file whose access is by record number.
- The AS400FileRecordDescription class
provides the methods for retrieving the record format of an AS/400
file.
The record-level access classes require an
AS400 object that represents the AS/400 system that has the
database files. Using the record-level access classes causes the
AS400 object to connect to the AS/400. 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