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: KeyedFile objects generate the following events:


Variable Index

 o KEY_EQ
Constant indicating search type of equal.
 o KEY_GE
Constant indicating search type of greater than or equal.
 o KEY_GT
Constant indicating search type of greater than.
 o KEY_LE
Constant indicating search type of less than or equal.
 o KEY_LT
Constant indicating search type of less than.
 o TYPE_TABLE

Constructor Index

 o KeyedFile()
Constructs a KeyedFile object.
 o KeyedFile(AS400, String)
Constructs a KeyedFile object.

Method Index

 o deleteRecord(byte[], int)
Deletes the record specified by key.
 o deleteRecord(Object[])
Deletes the record specified by key.
 o positionCursor(byte[], int)
Positions the file cursor to the first record matching the specified key.
 o positionCursor(byte[], int, int)
Positions the file cursor to the first record meeting the specified search criteria based on key.
 o positionCursor(Object[])
Positions the file cursor to the first record matching the specified key.
 o positionCursor(Object[], int)
Positions the file cursor to the first record meeting the specified search criteria based on key.
 o positionCursorAfter(byte[], int)
Positions the file cursor to the first record after the record specified by key.
 o positionCursorAfter(Object[])
Positions the file cursor to the first record after the record specified by key.
 o positionCursorBefore(byte[], int)
Positions the file cursor to the first record before the record specified by key.
 o positionCursorBefore(Object[])
Positions the file cursor to the first record before the record specified by key.
 o read(byte[], int)
Reads the first record with the specified key.
 o read(byte[], int, int)
Reads the first record meeting the specified search criteria based on key.
 o read(Object[])
Reads the first record with the specified key.
 o read(Object[], int)
Reads the first record meeting the specified search criteria based on key.
 o readAfter(byte[], int)
Reads the first record after the record with the specified key.
 o readAfter(Object[])
Reads the first record after the record with the specified key.
 o readAll()
Reads all the records in the file.
 o readBefore(byte[], int)
Reads the first record before the record with the specified key.
 o readBefore(Object[])
Reads the first record before the record with the specified key.
 o readNextEqual()
Reads the next record whose key matches the full key of the current record.
 o readNextEqual(byte[], int)
Reads the next record whose key matches the specified key.
 o readNextEqual(Object[])
Reads the next record whose key matches the specified key.
 o readPreviousEqual()
Reads the previous record whose key matches the key of the current record.
 o readPreviousEqual(byte[], int)
Reads the previous record whose key matches the specified key.
 o readPreviousEqual(Object[])
Reads the previous record whose key matches the specified key.
 o update(byte[], Record, int)
Updates the record specified by key.
 o update(byte[], Record, int, int)
Updates the first record meeting the specified search criteria based on key.
 o update(Object[], Record)
Updates the record specified by key.
 o update(Object[], Record, int)
Updates the first record meeting the specified search criteria based on key.

Variables

 o KEY_EQ
 public static final int KEY_EQ
Constant indicating search type of equal.

 o KEY_GT
 public static final int KEY_GT
Constant indicating search type of greater than.

 o KEY_GE
 public static final int KEY_GE
Constant indicating search type of greater than or equal.

 o KEY_LT
 public static final int KEY_LT
Constant indicating search type of less than.

 o KEY_LE
 public static final int KEY_LE
Constant indicating search type of less than or equal.

 o TYPE_TABLE
 protected static final int TYPE_TABLE[]

Constructors

 o KeyedFile
 public KeyedFile()
Constructs a KeyedFile object.

 o 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.

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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