All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.KeyedFile
java.lang.Object
|
+----com.ibm.as400.access.AS400File
|
+----com.ibm.as400.access.KeyedFile
- public class KeyedFile
- extends AS400File
- implements Serializable
The KeyedFile class represents an AS/400 physical or logical file.
It allows the user to do the following:
- Create an AS/400 physical file by:
- Specifying a record length.
- Specifying an existing AS/400 DDS source file.
- Specifying a RecordFormat object that contains a description of the
record format for the file.
- Access the records in an AS/400 file sequentially or by key.
- Write records to an AS/400 file sequentially or by key.
- Update records in an AS/400 file sequentially or by key.
- Lock an AS/400 file for different types of access.
- Use commitment control when accessing an AS/400 file. The user can:
- Start commitment control for the connection.
- Specify different commitment control lock levels for the individual AS/400
files being accessed.
- Commit and rollback transactions for the connection.
- Delete an AS/400 physical or logical file or member.
KeyedFile objects generate the following events:
-
KEY_EQ
- Constant indicating search type of equal.
-
KEY_GE
- Constant indicating search type of greater than or equal.
-
KEY_GT
- Constant indicating search type of greater than.
-
KEY_LE
- Constant indicating search type of less than or equal.
-
KEY_LT
- Constant indicating search type of less than.
-
TYPE_TABLE
-
-
KeyedFile()
- Constructs a KeyedFile object.
-
KeyedFile(AS400, String)
- Constructs a KeyedFile object.
-
deleteRecord(byte[], int)
- Deletes the record specified by key.
-
deleteRecord(Object[])
- Deletes the record specified by key.
-
positionCursor(byte[], int)
- Positions the file cursor to the first record matching the specified
key.
-
positionCursor(byte[], int, int)
- Positions the file cursor to the first record meeting the specified search criteria
based on key.
-
positionCursor(Object[])
- Positions the file cursor to the first record matching the specified
key.
-
positionCursor(Object[], int)
- Positions the file cursor to the first record meeting the specified search criteria
based on key.
-
positionCursorAfter(byte[], int)
- Positions the file cursor to the first record after the record specified
by key.
-
positionCursorAfter(Object[])
- Positions the file cursor to the first record after the record specified
by key.
-
positionCursorBefore(byte[], int)
- Positions the file cursor to the first record before the record specified
by key.
-
positionCursorBefore(Object[])
- Positions the file cursor to the first record before the record specified
by key.
-
read(byte[], int)
- Reads the first record with the specified key.
-
read(byte[], int, int)
- Reads the first record meeting the specified search criteria based on
key.
-
read(Object[])
- Reads the first record with the specified key.
-
read(Object[], int)
- Reads the first record meeting the specified search criteria based on
key.
-
readAfter(byte[], int)
- Reads the first record after the record with the specified key.
-
readAfter(Object[])
- Reads the first record after the record with the specified key.
-
readAll()
- Reads all the records in the file.
-
readBefore(byte[], int)
- Reads the first record before the record with the specified key.
-
readBefore(Object[])
- Reads the first record before the record with the specified key.
-
readNextEqual()
- Reads the next record whose key matches the full key of the current record.
-
readNextEqual(byte[], int)
- Reads the next record whose key matches the specified key.
-
readNextEqual(Object[])
- Reads the next record whose key matches the specified key.
-
readPreviousEqual()
- Reads the previous record whose key matches the key of the current record.
-
readPreviousEqual(byte[], int)
- Reads the previous record whose key matches the specified key.
-
readPreviousEqual(Object[])
- Reads the previous record whose key matches the specified key.
-
update(byte[], Record, int)
- Updates the record specified by key.
-
update(byte[], Record, int, int)
- Updates the first record meeting the specified search criteria based on
key.
-
update(Object[], Record)
- Updates the record specified by key.
-
update(Object[], Record, int)
- Updates the first record meeting the specified search criteria based on
key.
KEY_EQ
public static final int KEY_EQ
- Constant indicating search type of equal.
KEY_GT
public static final int KEY_GT
- Constant indicating search type of greater than.
KEY_GE
public static final int KEY_GE
- Constant indicating search type of greater than or equal.
KEY_LT
public static final int KEY_LT
- Constant indicating search type of less than.
KEY_LE
public static final int KEY_LE
- Constant indicating search type of less than or equal.
TYPE_TABLE
protected static final int TYPE_TABLE[]
KeyedFile
public KeyedFile()
- Constructs a KeyedFile object.
KeyedFile
public KeyedFile(AS400 system,
String name)
- Constructs a KeyedFile object. It uses the specified file.
If the name for the file does not include a member, the
first member of the file will be used.
- Parameters:
- system - The AS/400 system to which to connect. The system cannot
be null.
- name - The integrated file system pathname of the file. The name
cannot be null.
deleteRecord
public void deleteRecord(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Deletes the record specified by key. The file must be open when invoking
this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported. The number of elements in key cannot exceed the
number of key fields in the record format for this file.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
deleteRecord
public void deleteRecord(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Deletes the record specified by key. The file must be open when invoking
this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key. This number cannot exceed the
total number of key fields in the record format for this file.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursor
public void positionCursor(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record matching the specified
key. The file must be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursor
public void positionCursor(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record matching the specified
key. The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursor
public void positionCursor(Object key[],
int searchType) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record meeting the specified search criteria
based on key. The searchType indicates that the cursor should be
positioned to the record whose key first meets the search criteria when compared
to key. The file must be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursor
public void positionCursor(byte key[],
int searchType,
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record meeting the specified search criteria
based on key. The searchType indicates that the cursor should be
positioned to the record whose key first meets the search criteria when compared
to key. The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursorAfter
public void positionCursorAfter(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record after the record specified
by key. The file must be open when invoking this method.
- Parameters:
- key - The values which make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursorAfter
public void positionCursorAfter(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record after the record specified
by key. The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values which make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursorBefore
public void positionCursorBefore(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record before the record specified
by key. The file must be open when invoking this method.
- Parameters:
- key - The values which make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
positionCursorBefore
public void positionCursorBefore(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Positions the file cursor to the first record before the record specified
by key. The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values which make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
read
public Record read(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record with the specified key. The file must be open when
invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
read
public Record read(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record with the specified key. The file must be open when
invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
read
public Record read(Object key[],
int searchType) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record meeting the specified search criteria based on
key. The searchType indicates that the record whose key first meets
the search criteria when compared to key should be returned. The file must
be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
read
public Record read(byte key[],
int searchType,
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record meeting the specified search criteria based on
key. The searchType indicates that the record whose key first meets
the search criteria when compared to key should be returned. The file must
be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readAfter
public Record readAfter(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record after the record with the specified key. The file must
be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readAfter
public Record readAfter(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record after the record with the specified key. The file must
be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readAll
public Record[] readAll() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, InterruptedException, IOException, ServerStartupException, UnknownHostException
- Reads all the records in the file. The file must be closed when invoking this method.
The record format for the file must have been set prior to invoking this method.
- Returns:
- The records read. If no records are read, an array of size zero is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Throws: ServerStartupException
- If the AS/400 server cannot be started.
- Throws: UnknownHostException
- If the AS/400 system cannot be located.
- Overrides:
- readAll in class AS400File
readBefore
public Record readBefore(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record before the record with the specified key. The file must
be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readBefore
public Record readBefore(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the first record before the record with the specified key. The file must
be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readNextEqual
public Record readNextEqual() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the next record whose key matches the full key of the current record.
The file must be open when invoking this method. The file must be
positioned on an active record when invoking this method.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readNextEqual
public Record readNextEqual(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the next record whose key matches the specified key. The search does
not include the current record. The key may be a partial key.
The file must be open when invoking this method.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readNextEqual
public Record readNextEqual(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the next record whose key matches the specified key. The search does
not include the current record. The key may be a partial key.
The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readPreviousEqual
public Record readPreviousEqual() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the previous record whose key matches the key of the current record.
The file must be open when invoking this method. The file must be
positioned on an active record when invoking this method.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readPreviousEqual
public Record readPreviousEqual(Object key[]) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the previous record whose key matches the specified key. The search does
not include the current record. The key may be a partial key.
The file must be open when invoking this method.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
readPreviousEqual
public Record readPreviousEqual(byte key[],
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Reads the previous record whose key matches the specified key. The search does
not include the current record. The key may be a partial key.
The file must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Returns:
- The record read. If the record is not found, null is returned.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
update
public void update(Object key[],
Record record) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Updates the record specified by key. The file must be open when invoking
this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- record - The record with which to update the existing record.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
update
public void update(byte key[],
Record record,
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Updates the record specified by key. The file must be open when invoking
this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- record - The record with which to update the existing record.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
update
public void update(Object key[],
Record record,
int searchType) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Updates the first record meeting the specified search criteria based on
key. The searchType indicates that the record whose key first meets
the search criteria when compared to key should be returned. The file
must be open when invoking this method.
- Parameters:
- key - The values that make up the key with which to find the record.
The key must contain at least one element. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- record - The record with which to update the existing record.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
update
public void update(byte key[],
Record record,
int searchType,
int numberOfKeyFields) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- Updates the first record meeting the specified search criteria based on
key. The searchType indicates that the record whose key first meets
the search criteria when compared to key should be returned. The file
must be open when invoking this method.
- Parameters:
- key - The byte array that contains the byte values that make up the key with which to find the record.
The byte array key must contain the byte values from at least one key field. The types and order of
the elements that make up key must match the type and order of the
key fields in the record format for this object. Null values for key fields
are not supported.
- record - The record with which to update the existing record.
- searchType - Constant indicating the type of match required. Valid values are:
- KEY_EQ
First record whose key is equal to key.
- KEY_LT
First record whose key is less than key.
- KEY_LE
First record whose key is less than or equal to key.
- KEY_GT
First record whose key is greater than key.
- KEY_GE
First record whose key is greater than or equal to key.
- numberOfKeyFields - The number of key fields contained in the byte array key.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
All Packages Class Hierarchy This Package Previous Next Index