Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.ui
Class RecordIOManager

java.lang.Object
  extended by com.ibm.etools.iseries.ui.RecordIOManager
All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, Serializable, Cloneable, EventListener

public class RecordIOManager
extends Object
implements PropertyChangeListener, VetoableChangeListener, Serializable, Cloneable

RecordIOManager allows data manipulation of a particular record format of a database file (a physical or logical file), using AS/400 record-level access. For logical files, only data retrieval is allowed and record addition, updating, and deletions is prohibited.

Note: RecordIOManager uses the AS/400 Toolbox record-level access classes which do not support logical join files or null key fields.

Each standalone RecordIOManager object can only manipulate data of one record format of a database file. When access to multiple record formats or multiple database files is required, RecordIOManager can join with another instance of RecordIOManager, then only records whose foreign keys matches the key values of the joined record format can be accessed. For example, database file PRODDTL has following records and the database key is PARTNO:

PARTNO MODEL PARTD INVENTORY PARTSHIP PARTPIC
00005 m5 Battery Charger 50 2000-02-05 c:\abc\a
00008 m8 Extension cord 80 2000-02-08 c:\abc\b
00011 m11 Power line 110 2000-02-11 c:\abc\c
00015 m15 Adapter 150 2000-02-15 c:\abc\d

Database file MODEL has following records, the keys of MODEL are MODEL and PARTSHIP:

MODEL PARTSHIP MANUFACT ADDRESS CITY
m1 2000-02-01 X Manufacturer 11 Avenue Rd. North York
m8 2000-02-08 B Manufacturer 88 Main St. Markham
m15 2000-02-15 D Manufacturer 15 King St. Toronto
m21 2000-02-21 Y Manufacturer 21 Toronto St. Toronto

To join the two database files together, use the joinDatabase(String[] foreignKeys, RecordIOManager database) method, where foreignKeys is a String array of two elements with values set to MODEL and PARTSHIP; and database is the RecordIOManager whose associated database file is MODEL. The file access type of both database files must be FILEACCESS_KEYED. Only the following records will be retrieved in readAllRecords() method:

PARTNO MODEL PARTD INVENTORY PARTSHIP PARTPIC MANUFACT ADDRESS CITY
00008 m8 Extension cord 80 2000-02-08 c:\abc\b B Manufacturer 88 Main St. Markham
00015 m15 Adapter 150 2000-02-15 c:\abc\d D Manufacturer 15 King St. Toronto

RecordIOManager can set conditions on records that can be accessed. For examples, a condition can be set for the above example where only records with PARTNO="00015" can be accessed:

PARTNO MODEL PARTD INVENTORY PARTSHIP PARTPIC MANUFACT ADDRESS CITY
00015 m15 Adapter 150 2000-02-15 c:\abc\d D Manufacturer 15 King St. Toronto

If RecordIOManager is used inside VisualCompositionEditor of VisualAge for Java, then a check condition class will be generated upon specifying the conditions on the Condition page of the custom property editor. If this bean is not used inside VisualCompositionEditor, or if user has very complex conditions that the Condition page cannot meet the user requirement, user can define his/her own check condition class. This check condition class must extends AbstractCondition, and the check condition class must implements a method isConditionValid(com.ibm.as400.access.Record record), which return a boolean value to determine if record can be accessed. If the return value is true, record can be accessed; otherwise record will be skipped.

RecordIOManager has the the following default properties:

RecordIOManager allows you to do the following:

See Also:
AbstractCondition, FormManager, ListManager, Serialized Form

Field Summary
static int COMMITLOCKLEVEL_ALL
          Constant indicating a commit lock level of *ALL.
static int COMMITLOCKLEVEL_CHANGE
          Constant indicating a commit lock level of *CHANGE.
static int COMMITLOCKLEVEL_CURSOR_STABILITY
          Constant indicating a commit lock level of *CS.
static int COMMITLOCKLEVEL_NONE
          Constant indicating that no commitment control should be used for the file.
static String Copyright
           
static int FILEACCESS_KEYED
          Constant indicating keyed file access type.
static int FILEACCESS_SEQUENTIAL
          Constant indicating sequential file access type
static int LOCK_READ_ALLOW_SHARED_READ
          Constant indicating lock type of read willing to share with other readers.
static int LOCK_READ_ALLOW_SHARED_WRITE
          Constant indicating lock type of read willing to share with updaters.
static int LOCK_READ_EXCLUSIVE
          Constant indicating lock type of update willing to share with no one.
static int LOCK_WRITE_ALLOW_SHARED_READ
          Constant indicating lock type of update willing to share with readers.
static int LOCK_WRITE_ALLOW_SHARED_WRITE
          Constant indicating lock type of update willing to share with updaters.
static int LOCK_WRITE_EXCLUSIVE
          Constant indicating lock type of update willing to share with no one.
static String methodName
           
static int OPENTYPE_READ_ONLY
          Constant indicating open type of read only.
static int OPENTYPE_READ_WRITE
          Constant indicating open type of read/write.
protected  PropertyChangeSupport propertyChange
           
static int SEARCHTYPE_KEY_EQ
          Constant indicating search type of equal.
static int SEARCHTYPE_KEY_GE
          Constant indicating search type of greater than or equal.
static int SEARCHTYPE_KEY_GT
          Constant indicating search type of greater than.
static int SEARCHTYPE_KEY_LE
          Constant indicating search type of less than or equal
static int SEARCHTYPE_KEY_LT
          Constant indicating search type of less than.
protected  VetoableChangeSupport vetoPropertyChange
           
 
Constructor Summary
RecordIOManager()
          RecordIOManager constructor.
RecordIOManager(String recIOMgrSpecClassName)
          RecordIOManager constructor.
RecordIOManager(String filename, String library)
          RecordIOManager constructor.
RecordIOManager(String server, String userid, String password, String filename, String library)
          RecordIOManager constructor.
RecordIOManager(String server, String userid, String password, String fileName, String library, int fileAccessType, int openType, int packetSize, int commitLockLevel, String journal, String journalLibrary)
          RecordIOManager constructor.
RecordIOManager(String server, String userid, String password, String fileName, String library, int fileAccessType, int openType, int packetSize, int commitLockLevel, String journal, String journalLibrary, String recordFormatName, ArrayList selectedColumns)
          RecordIOManager constructor.
RecordIOManager(String server, String userid, String password, String fileName, String library, int fileAccessType, int openType, int packetSize, int commitLockLevel, String journal, String journalLibrary, String recordFormatName, ArrayList selectedColumns, String checkCondPackageName, String checkCondClassName)
          RecordIOManager constructor.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          The addPropertyChangeListener method was generated to support the propertyChange field.
 boolean addRecord(DefaultTableModel tableModel)
          Add a new record to the database file.
protected  boolean addRecord(Vector fieldDataVector)
          User should never use this method, unexpected result may occur.
 void addVetoableChangeListener(VetoableChangeListener l)
          Add a vetoableChangeListener.
 void cancelReadAllRecords()
          Depends on the size of the file(s), the operation of readAllRecords() may take a long time to complete.
 Object clone()
          Clone the current object.
 void closeFile()
          Closes the database file on the AS400.
 void commit()
          Commits all transactions since the last commit boundary.
 void connect()
          Connects to an com.ibm.as400.access.AS400.RECORDACCESS service on the AS/400 system specified in property system.
static String Copyright()
          Copyright notice.
 TableModel dataOnlyResultSetTableModel(DefaultTableModel resultSetTableModel)
          Return the result set of the last operation.
 boolean deleteRecord(int[] recordNumbers)
          Deletes the records specified by record numbers in joined database files.
 boolean deleteRecord(String[] keyValues)
          Only the record with the specified keys will be deleted from the current database, records in joined databases will not be deleted.
 void disconnect()
          Ends commitment control for this connection.
protected  void doHookConnect()
          User should never use this method, unexpected result may occur.
 boolean endJournalPhysicalFile()
          The method will call ENDJRNPF command on the AS/400 server to end a journal physical file specified in property jounral and journalLibrary.
 boolean getAscendingOrder()
          Gets the ascendingOrder property.
protected  ArrayList getAvailableColumnStringList()
          User should never use this method, unexpected result may occur.
 String getCheckConditionClassName()
          Gets the checkConditionClassName property value, i.e.
 String getCheckConditionExtendedName()
          Gets the checkConditionExtendedName property value, i.e.
 String getCheckConditionPackageName()
          Gets the checkConditionPackageName property value, i.e.
 int getCommitLockLevel()
          Gets the commitLockLevel property value.
protected  boolean getConditionChanged()
          User should never use this method, unexpected result may occur.
protected  ArrayList getConditionList()
          User should never use this method, unexpected result may occur.
protected  String getDatafileName()
          User should never use this method, unexpected result may occur.
 int getDebugLevel()
          Gets the debugLevel property value.
 int getFileAccessType()
          Gets the fileAccessType property value.
 String getFileName()
          Gets the fileName property value.
protected  boolean getHasFileBeenOpened()
          User should never use this method, unexpected result may occur.
 String getJournal()
          Gets the journal property value.
 String getJournalLibrary()
          Gets the JournalLibrary property value.
 String getLibrary()
          Gets the library property value.
protected  int getNKeyFields()
          User should never use this method, unexpected result may occur.
 int getOpenType()
          Gets the openType property value.
 int getPacketSize()
          Gets the packetSize property value.
 String getPassword()
          Gets the password od userid to logon to the server specified in property server.
protected  PropertyChangeSupport getPropertyChange()
          User should never use this method, unexpected result may occur.
protected  boolean getReadingAll()
          User should never use this method, unexpected result may occur.
protected  ArrayList getRecFormatStringList()
          User should never use this method, unexpected result may occur.
 String getRecIOMgrClassName()
          Gets the recIOMgrClassName property value, i.e.
 String getRecIOMgrExtendedName()
          Gets the recIOMgrExtendedName property value, i.e.
 String getRecIOMgrPackageName()
          Gets the recIOMgrPackageName property value, i.e.
 int getRecNum()
           
 RecordFormat getRecordFormat()
          Gets the record format of the database file specified by property recordFormatName.
 String getRecordFormatName()
          Gets the recordFormatName property value, i.e.
 ResourceBundle getResource()
          Return resource bundle.
 DefaultTableModel getResultSetTableModel()
          Gets the resultSetTableModel property value.
 ArrayList getSelectedColumnNames()
          Gets the selectedColumnNames property value, i.e.
 String getServer()
          Gets the server property value.
 AS400 getSystem()
          Gets the AS400 system object of the server specified in property server.
 boolean getThreadUsed()
          Gets the threadUsed property value.
 String getUserid()
          Gets the user id to logon to the server specified in property server.
protected  VetoableChangeSupport getVetoPropertyChange()
          Accessor for the vetoPropertyChange field.
protected  void handleException(String messageHeader, Throwable e)
          Print a throwable exception to the console with a message header if debug is greater than 0.
protected  void handleException(Throwable e)
          Prints the Throwable e and its backtrace to the standard error stream if debug is greater than 0.
protected  boolean isConditionValid(Record currentRecord)
          User should never use this method, unexpected result may occur.
 void joinDataBase(String[] foreignKeyNames, RecordIOManager database)
          To join the database file specified in property fileName and library, with another database file specified in another RecordIOManager object's fileName and library.
 boolean lockDatabase(int lockType)
          Obtains a lock on the database file.
protected  void mapDataFieldNames(Vector dfuCompVector)
          User should never use this method, unexpected result may occur.
 boolean openFile()
          Opens a database file based on the property values of fileName, library, server, system, openType, fileAccessType, recordFormatName, commitLockLevel.
 boolean positionCursor(int recordNumber)
          Position the cursor of the database file to the specified recordNumber.
 boolean positionCursor(String[] keyValues)
          Position the cursor of the database file to the record with the specified keys.
 boolean positionCursorAfterLast()
          Positions the file cursor to after the last record.
 boolean positionCursorBeforeFirst()
          Positions the file cursor to before the first record.
 boolean positionCursorToFirst()
          Positions the cursor to the first record in the file.
 boolean positionCursorToLast()
          Positions the cursor to the last record in the file.
 boolean positionCursorToNext()
          Positions the cursor to the next record that satisfies the conditions determined in the isConditionValid() method of check condition class.
 boolean positionCursorToPrevious()
          Positions the cursor to the previous record that satisfies the conditions determined in the isConditionValid() method of check condition class.
 void propertyChange(PropertyChangeEvent e)
          Examine the PropertyChangeEvent and decides what to do on a particular event.
 DefaultTableModel readAllRecords()
          Reads all the records that satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readAllRecordsEqual(String[] keyValues)
          Reads all the records that equal the specified keyValues and satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readFirstSetOfRecords()
          Reads the first set of records that satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readNextRecord()
          Reads the next record that satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readNextRecordEqual(String[] keyValues)
          Reads the next record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readNextSetOfRecords()
          Reads the next set of records from the current file cursor position, records retrieved has to satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readPreviousRecord()
          Reads the previous record that satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readPreviousRecordEqual(String[] keyValues)
          Reads the previous record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readPreviousSetOfRecords()
          Reads the previous set of records from the current file cursor position, records retrieved has to satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readRecord()
          Reads the next record from current file cursor position that satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readRecord(int recordNumber)
          Reads the record with the specified recordNumber.
 DefaultTableModel readRecord(String[] keyValues)
          Reads the record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class.
 DefaultTableModel readRecord(String[] keyValues, int searchType)
          Reads the first record meeting the specified search criteria based on keyValues and satisfy the conditions determined in the isConditionValid() method of check condition class.
protected  boolean readRecordJoinDatabase(String[] keyStringValues, int searchType, boolean writeData)
          User should never use this method, unexpected result may occur.
 void removePropertyChangeListener(PropertyChangeListener listener)
          The removePropertyChangeListener method was generated to support the propertyChange field.
 void removeVetoableChangeListener(VetoableChangeListener l)
          Removes a vetoableChangeListener.
protected  Object restoreInfoBlock(String methodName)
          User should never use this method, unexpected result may occur.
 void rollback()
          Rolls back any transactions since the last commit/rollback boundary.
 void setAscendingOrder(boolean order)
          Set the order of record retrieval.
protected  void setAvailableColumnStringList(ArrayList availList)
          User should never use this method, unexpected result may occur.
 void setCheckConditionClassName(String name)
          Set the class name of the check condition class.
 void setCheckConditionPackageName(String name)
          Set the package of which the check condition class belongs.
 void setCommitLockLevel(int commitLevel)
          Sets the commitLockLevel for the database file specified in property fileName and library.
protected  void setConditionChanged(boolean value)
          User should never use this method, unexpected result may occur.
protected  void setConditionList(ArrayList l)
          User should never use this method, unexpected result may occur.
 void setDebugLevel(int value)
          Sets the debugLevel property value.
protected  void setDfuComponentVector(Vector v)
          User should never use this method, unexpected result may occur.
 void setFileAccessType(int type)
          Sets the fileAccessType property value.
 void setFileName(String file)
          Sets the fileName property value.
 void setJournal(String journalName)
          Sets the journal property value.
 void setJournalLibrary(String library)
          Gets the journalLibrary property value.
 void setLibrary(String lib)
          Sets the library property value.
 void setOpenType(int type)
          Sets the openType property (int) value.
 void setPacketSize(int size)
          Sets the packetSize property (int) value.
 void setPassword(String pwd)
          Sets the password of userid to logon to the server specified in property server.
protected  void setPrimaryDatabase(boolean value)
          User should never use this method, unexpected result may occur.
protected  void setReadingAll(boolean value)
          User should never use this method, unexpected result may occur.
protected  void setRecFormatStringList(ArrayList rf)
          User should never use this method, unexpected result may occur.
 void setRecIOMgrClassName(String name)
          Sets the recIOMgrClassName property value.
 void setRecIOMgrPackageName(String name)
          Sets the recIOMgrPackageName property value.
 void setRecordFormatName(String name)
          Sets the record format name of the database file.
 void setResultSetTableModel(DefaultTableModel model)
          Set the DefaultTableModel used for result set.
 void setSelectedColumnNames(ArrayList names)
          Sets the selectedColumnNames property value,
 void setServer(String s)
          Sets the server property value.
 void setSystem(AS400 sys)
          Sets the system property value.
 void setThreadUsed(boolean useThreads)
          Sets whether the bean uses threads in communication with the host servers.
 void setUserid(String id)
          Sets the user id to logon to the server specified in property server.
 boolean startJournalPhysicalFile()
          The method will call STRJRNPF command on the AS/400 server to start a journal physical file specified in property journal and journalLibrary.
 boolean updateRecord(DefaultTableModel tableModel)
          Update a record in the database file.
 boolean updateRecord(int[] recordNumbers, DefaultTableModel tableModel)
          Update a record in the database file.
protected  boolean updateRecord(int[] recordNumbers, Vector fieldDataVector)
          User should never use this method, unexpected result may occur.
 boolean updateRecord(String[] keyValues, DefaultTableModel tableModel)
          Update a record in the database file by keys.
 void vetoableChange(PropertyChangeEvent e)
          This method gets called when a constrained property is changed.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

FILEACCESS_KEYED

public static final int FILEACCESS_KEYED
Constant indicating keyed file access type.

See Also:
openFile(), Constant Field Values

FILEACCESS_SEQUENTIAL

public static final int FILEACCESS_SEQUENTIAL
Constant indicating sequential file access type

See Also:
openFile(), Constant Field Values

SEARCHTYPE_KEY_EQ

public static final int SEARCHTYPE_KEY_EQ
Constant indicating search type of equal.


SEARCHTYPE_KEY_GE

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


SEARCHTYPE_KEY_GT

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


SEARCHTYPE_KEY_LE

public static final int SEARCHTYPE_KEY_LE
Constant indicating search type of less than or equal


SEARCHTYPE_KEY_LT

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


OPENTYPE_READ_WRITE

public static final int OPENTYPE_READ_WRITE
Constant indicating open type of read/write.

See Also:
openFile()

OPENTYPE_READ_ONLY

public static final int OPENTYPE_READ_ONLY
Constant indicating open type of read only.

See Also:
openFile()

COMMITLOCKLEVEL_ALL

public static final int COMMITLOCKLEVEL_ALL
Constant indicating a commit lock level of *ALL. Every record accessed in the file is locked until the transaction is committed or rolled back.

See Also:
openFile()

COMMITLOCKLEVEL_CHANGE

public static final int COMMITLOCKLEVEL_CHANGE
Constant indicating a commit lock level of *CHANGE. Every record read for update is locked. If a record is updated, added, or deleted, that record remains locked until the transaction is committed or rolled back. Records that are accessed for update but are released without being updated are unlocked.

See Also:
openFile()

COMMITLOCKLEVEL_CURSOR_STABILITY

public static final int COMMITLOCKLEVEL_CURSOR_STABILITY
Constant indicating a commit lock level of *CS. Every record accessed is locked. Records that are not updated or deleted are locked only until a different record is accessed. Records that are updated, added, or deleted are locked until the transaction is committed or rolled back.

See Also:
openFile()

COMMITLOCKLEVEL_NONE

public static final int COMMITLOCKLEVEL_NONE
Constant indicating that no commitment control should be used for the file. No commitment control will apply to this file.

See Also:
openFile()

LOCK_READ_EXCLUSIVE

public static final int LOCK_READ_EXCLUSIVE
Constant indicating lock type of update willing to share with no one. This is the equivalent of specifying *EXCL on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

LOCK_READ_ALLOW_SHARED_READ

public static final int LOCK_READ_ALLOW_SHARED_READ
Constant indicating lock type of read willing to share with other readers. This is the equivalent of specifying *SHRNUP on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

LOCK_READ_ALLOW_SHARED_WRITE

public static final int LOCK_READ_ALLOW_SHARED_WRITE
Constant indicating lock type of read willing to share with updaters. This is the equivalent of specifying *SHRRD on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

LOCK_WRITE_EXCLUSIVE

public static final int LOCK_WRITE_EXCLUSIVE
Constant indicating lock type of update willing to share with no one. This is the equivalent of specifying *EXCL on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

LOCK_WRITE_ALLOW_SHARED_READ

public static final int LOCK_WRITE_ALLOW_SHARED_READ
Constant indicating lock type of update willing to share with readers. This is the equivalent of specifying *EXCLRD on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

LOCK_WRITE_ALLOW_SHARED_WRITE

public static final int LOCK_WRITE_ALLOW_SHARED_WRITE
Constant indicating lock type of update willing to share with updaters. This is the equivalent of specifying *SHRUPD on the AS/400 Allocate Object (ALCOBJ) command.

See Also:
lockDatabase(int)

methodName

public static final String methodName
See Also:
Constant Field Values

propertyChange

protected transient PropertyChangeSupport propertyChange

vetoPropertyChange

protected transient VetoableChangeSupport vetoPropertyChange
Constructor Detail

RecordIOManager

public RecordIOManager()
RecordIOManager constructor.


RecordIOManager

public RecordIOManager(String recIOMgrSpecClassName)
RecordIOManager constructor.

Parameters:
recIOMgrSpecClassName - full name of the RecordIOManager serialized data class, e.g. com.ibm.ivj.examples.et400.dfubeans.ModelNoCond.

RecordIOManager

public RecordIOManager(String filename,
                       String library)
                throws PropertyVetoException
RecordIOManager constructor.

Parameters:
filename - Name of a physical or logical file.
library - Name of the library where the database file resides
Throws:
PropertyVetoException

RecordIOManager

public RecordIOManager(String server,
                       String userid,
                       String password,
                       String filename,
                       String library)
                throws PropertyVetoException
RecordIOManager constructor.

Parameters:
server - Name or the IP address of the server where the database file resides.
userid - used to log on to the server.
password - Password of userid to log on to the server.
filename - Name of a physical or logical file.
library - Name of the library where the database file resides
Throws:
PropertyVetoException

RecordIOManager

public RecordIOManager(String server,
                       String userid,
                       String password,
                       String fileName,
                       String library,
                       int fileAccessType,
                       int openType,
                       int packetSize,
                       int commitLockLevel,
                       String journal,
                       String journalLibrary)
                throws PropertyVetoException
RecordIOManager constructor.

Parameters:
server - Name or the IP address of the server where the database file resides.
userid - Id used to log on to the server.
password - Password of userid to log on to the server.
filename - Name of a physical or logical file.
library - Name of the library where the database file resides.
fileAccessType - File access type, valid values are:
  • FILEACCESS_KEYED
    Keyed file access.
  • FILEACCESS_SEQUENTIAL
    Sequential file access.
openType - File open type, valid values are:
  • OPENTYPE_READ_WRITE
    read/write.
  • OPENTYPE_READ_ONLY
    read only.
packetSize - Number of records to be read in a packet. To be used by methods: readFirstSetOfRecords, readNextSetOfRecords, and readPreviousSetOfRecords.
commitLockLevel - int
  • COMMITLOCKLEVEL_ALL
    Commit lock level of *ALL.
  • COMMITLOCKLEVEL_CHANGE
    Commit lock level of *CHANGE.
  • COMMITLOCKLEVEL_CURSOR_STABILITY
    Commit lock level of *CS.
  • COMMITLOCKLEVEL_NONE
    No commitment control should be used for the file.
journal - Name of the journal
journalLibrary - Name of the library where the journal resides.
Throws:
PropertyVetoException

RecordIOManager

public RecordIOManager(String server,
                       String userid,
                       String password,
                       String fileName,
                       String library,
                       int fileAccessType,
                       int openType,
                       int packetSize,
                       int commitLockLevel,
                       String journal,
                       String journalLibrary,
                       String recordFormatName,
                       ArrayList selectedColumns)
                throws PropertyVetoException
RecordIOManager constructor.

Parameters:
server - Name or the IP address of the server where the database file resides.
userid - Id used to log on to the server.
password - Password of userid to log on to the server.
filename - Name of a physical or logical file.
library - Name of the library where the database file resides.
fileAccessType - File access type, valid values are:
  • FILEACCESS_KEYED
    Keyed file access.
  • FILEACCESS_SEQUENTIAL
    Sequential file access.
openType - File open type, valid values are:
  • OPENTYPE_READ_WRITE
    read/write.
  • OPENTYPE_READ_ONLY
    read only.
packetSize - Number of records to be read in a packet. To be used by methods: readFirstSetOfRecords, readNextSetOfRecords, and readPreviousSetOfRecords.
commitLockLevel - int
  • COMMITLOCKLEVEL_ALL
    Commit lock level of *ALL.
  • COMMITLOCKLEVEL_CHANGE
    Commit lock level of *CHANGE.
  • COMMITLOCKLEVEL_CURSOR_STABILITY
    Commit lock level of *CS.
  • COMMITLOCKLEVEL_NONE
    No commitment control should be used for the file.
journal - Name of the journal
journalLibrary - Name of the library where the journal resides.
recordFormatName - Name of the record format to be used.
selectedColumns - List of fields to work with in the record format.
Throws:
PropertyVetoException

RecordIOManager

public RecordIOManager(String server,
                       String userid,
                       String password,
                       String fileName,
                       String library,
                       int fileAccessType,
                       int openType,
                       int packetSize,
                       int commitLockLevel,
                       String journal,
                       String journalLibrary,
                       String recordFormatName,
                       ArrayList selectedColumns,
                       String checkCondPackageName,
                       String checkCondClassName)
                throws PropertyVetoException
RecordIOManager constructor.

Parameters:
server - Name or the IP address of the server where the database file resides.
userid - Id used to log on to the server.
password - Password of userid to log on to the server.
filename - Name of a physical or logical file.
library - Name of the library where the database file resides.
fileAccessType - File access type, valid values are:
  • FILEACCESS_KEYED
    Keyed file access.
  • FILEACCESS_SEQUENTIAL
    Sequential file access.
openType - File open type, valid values are:
  • OPENTYPE_READ_WRITE
    read/write.
  • OPENTYPE_READ_ONLY
    read only.
packetSize - Number of records to be read in a packet. To be used by methods: readFirstSetOfRecords, readNextSetOfRecords, and readPreviousSetOfRecords.
commitLockLevel - int
  • COMMITLOCKLEVEL_ALL
    Commit lock level of *ALL.
  • COMMITLOCKLEVEL_CHANGE
    Commit lock level of *CHANGE.
  • COMMITLOCKLEVEL_CURSOR_STABILITY
    Commit lock level of *CS.
  • COMMITLOCKLEVEL_NONE
    No commitment control should be used for the file.
journal - Name of the journal
journalLibrary - Name of the library where the journal resides.
recordFormatName - Name of the record format to be used.
selectedColumns - List of fields to work with in the record format.
checkCondPackageName - Package of the check condition class.
checkCondClassName - Name of the check condition class.
Throws:
PropertyVetoException
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field.


addRecord

protected boolean addRecord(Vector fieldDataVector)
                     throws AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException,
                            InvalidFieldDataException
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.

Throws:
AS400Exception
AS400SecurityException
InterruptedException
IOException
InvalidFieldDataException
See Also:
addRecord(DefaultTableModel)

addRecord

public boolean addRecord(DefaultTableModel tableModel)
                  throws AS400Exception,
                         AS400SecurityException,
                         InterruptedException,
                         IOException,
                         InvalidFieldDataException
Add a new record to the database file. If the file is not opened when invoking this method, openFile() will be called automatically. To invoke this method, the file access type can be FILEACCESS_KEYED or FILEACCESS_SEQUENTIAL.

Parameters:
tableModel - A DefaultTableModel to hold the data of a record. The header of each column in the tableModel has to be in the format of library.fileName.fieldName, e.g. for field PARTNO in file PRODDTL in library ADTSLAB, then the header should be ADTSLAB.PRODDTL.PARTNO. Data of each field should be placed in the appropriate column. Only the first row of data in the tableModel will be added to the database. If the database is joined with another database, then tableModel can have fields from both databases. The following is an example of how a tableModel can look like:
ADTSLAB.PRODDTL.PARTNO ADTSLAB.PRODDTL.MODEL ADTSLAB.PRODDTL.PARTD ADTSLAB.PRODDTL.INVENTORY ADTSLAB.PRODDTL.PARTSHIP ADTSLAB.PRODDTL.PARTPIC ADTSLAB.MODEL.MODEL ADTSLAB.MODEL.PARTSHIP ADTSLAB.MODEL.MANUFACT ADTSLAB.MODEL.ADDRESS ADTSLAB.MODEL.CITY
00015 m15 Adapter 150 2000-02-15 c:\abc\d m15 2000-02-15 D Manufacturer 15 King St. Toronto

This tableModel has data for two databases, addRecord method will add records to both PRODDTL and MODEL, provided that they are joined. The order of the columns in the tableModel does not make a difference. If a field is missing from the tableModel, then the following default values will assigned to the missing field according to its data type:

DATA TYPE DEFAULT VALUE
binary (B) 0
character (A) ""
DBCS Either (E) ""
DBCS Graphic (G) ""
DBCS Only (J) ""
DBCS Open (O) ""
date (L) "0001-01-01"
float (F) 0
hexadecimal (H) 0x40
packed decimal (P) 0
time (T) "00.00.00"
timestamp (Z) "0001-01-01-00.00.00.000000"
zoned decimal (S) 0
Returns:
True will be returned if the record is added successfully; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
InvalidFieldDataException - Invalid data in one or more fields.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
addRecord(Vector)

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener l)
Add a vetoableChangeListener.

Parameters:
l - java.beans.VetoableChangeListener

cancelReadAllRecords

public void cancelReadAllRecords()
Depends on the size of the file(s), the operation of readAllRecords() may take a long time to complete. This method allows user to cancel the readAllRecords operation at any time, but has to be done by another thread.

See Also:
readAllRecords()

clone

public Object clone()
Clone the current object.

Overrides:
clone in class Object
Returns:
The clone object.

closeFile

public void closeFile()
               throws AS400Exception,
                      AS400SecurityException,
                      InterruptedException,
                      IOException
Closes the database file on the AS400. All file locks held by this connection are released. All uncommitted transactions against the file are rolled back if commitment control has been started. All the joined database files are closed. If file is not opened, nothing is performed.

Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
openFile()

commit

public void commit()
            throws AS400Exception,
                   AS400SecurityException,
                   InterruptedException,
                   IOException
Commits all transactions since the last commit boundary. Invoking this method will cause all transactions under commitment control for this connection to be committed. This means that any database file opened under this connection, for which a commit lock level was specified, will have outstanding transactions committed. If commitment control has not been started for the connection, no action is taken.

Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
rollback()

connect

public void connect()
             throws AS400SecurityException,
                    IOException
Connects to an com.ibm.as400.access.AS400.RECORDACCESS service on the AS/400 system specified in property system. Security is validated and a connection is established to the AS/400.

Throws:
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400SecurityException
IOException
See Also:
disconnect()

Copyright

public static String Copyright()
Copyright notice.

Returns:
java.lang.String

dataOnlyResultSetTableModel

public TableModel dataOnlyResultSetTableModel(DefaultTableModel resultSetTableModel)
Return the result set of the last operation. This result set only consists of data. The difference between this result set and the result set returned from method getResultSetTableModel is this one does not contains the record number of each database file.

Parameters:
resultSetTableModel - returned from methods such as readAllRecords, readNextRecord, etc.
Returns:
javax.swing.table.TableModel

deleteRecord

public boolean deleteRecord(int[] recordNumbers)
                     throws RecordNotFoundException,
                            AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException
Deletes the records specified by record numbers in joined database files. This delete method requires you to provide all the record numbers of all joined database files in an integer array. If the file is not opened when invoking this method, openFile() will be called automatically. To invoke this method, the file access type can be FILEACCESS_KEYED or FILEACCESS_SEQUENTIAL.

Parameters:
recordNumbers - An array of int. The first int element represents the record number of the record to be delete in the primary database file, the second int element represent the record number of the record to be delete in the joined database file, the third int element represent the record number of the record to be delete in next joined database file, and so forth. If the database file is not joined, then only need to specify an array of one element, and the int value is the record number of the record to be delete in the database file.
Returns:
True if records are deleted successfully; false otherwise.
Throws:
RecordNotFoundException - Records with the specified recordNumbers are not found.
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

deleteRecord

public boolean deleteRecord(String[] keyValues)
                     throws RecordNotFoundException,
                            AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException
Only the record with the specified keys will be deleted from the current database, records in joined databases will not be deleted. This method is not designed to handle duplicate key file. To delete record with duplicate keys, use deleteRecord(int) or deleteRecord(int[]). The method will perform a read with the specified keys, the first record that matches the keyValues will be locate, and then perform a deletion.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The key may be a partial key. See readRecord(String[]) method for details.
Returns:
True if record is deleted successfully; else false is returned.
Throws:
RecordNotFoundException
AS400Exception
AS400SecurityException
InterruptedException
IOException

disconnect

public void disconnect()
                throws AS400Exception,
                       AS400SecurityException,
                       InterruptedException,
                       IOException
Ends commitment control for this connection. If commitment control has not been started for the connection, no action is taken. Disconnects the service com.ibm.as400.access.AS400.RECORDACCESS from the AS/400. All socket connections associated with this service and this AS400 object will be closed.

Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
connect()

doHookConnect

protected void doHookConnect()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


endJournalPhysicalFile

public boolean endJournalPhysicalFile()
                               throws AS400Exception,
                                      AS400SecurityException,
                                      InterruptedException,
                                      IOException,
                                      ErrorCompletingRequestException,
                                      ExtendedIllegalStateException
The method will call ENDJRNPF command on the AS/400 server to end a journal physical file specified in property jounral and journalLibrary.

Returns:
True if the journal physical file is ended successfully; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
com.ibm.as400.access.ErrorCompletingRequestException - If an error occurs before the request is completed.
com.ibm.as400.access.ExtendedIllegalStateException - An object is not in the proper state to perform the requested operation.
AS400Exception
AS400SecurityException
InterruptedException
IOException
ErrorCompletingRequestException
ExtendedIllegalStateException
See Also:
startJournalPhysicalFile()

getAscendingOrder

public boolean getAscendingOrder()
Gets the ascendingOrder property. If the file access type is RecordIOManager.FILEACCESS_KEYED, and ascendingOrder is true, records will be accessed in ascending order by key value; otherwise, records will be accessed in descending order by key value. If the file access type is RecordIOManager.FILEACCESS_SEQUENTIAL, and ascendingOrder is true, records will be accessed in ascending sequential order; otherwise will be accessed in descending sequential order.

Returns:
boolean
See Also:
setAscendingOrder(boolean)

getAvailableColumnStringList

protected ArrayList getAvailableColumnStringList()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getCheckConditionClassName

public String getCheckConditionClassName()
Gets the checkConditionClassName property value, i.e. the class name of the check condition class.

Returns:
java.lang.String
See Also:
setCheckConditionClassName(java.lang.String)

getCheckConditionExtendedName

public String getCheckConditionExtendedName()
Gets the checkConditionExtendedName property value, i.e. the extended class name of the check condition class with package name, e.g. com.ibm.ivj.examples.et400.dfubeans.ConditionModel.

Returns:
java.lang.String

getCheckConditionPackageName

public String getCheckConditionPackageName()
Gets the checkConditionPackageName property value, i.e. the package of the check condition class.

Returns:
java.lang.String

getCommitLockLevel

public int getCommitLockLevel()
Gets the commitLockLevel property value.

See Also:
setCommitLockLevel(int)

getConditionChanged

protected boolean getConditionChanged()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getConditionList

protected ArrayList getConditionList()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getDatafileName

protected String getDatafileName()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getDebugLevel

public int getDebugLevel()
Gets the debugLevel property value. If debugLevel is 0, no exceptions, nor any messages will be displayed in the console. If debugLevel is 1, only exceptions are displayed in the console. If debugLevel is >=2, all messages including exceptions, error and informational messages are dumped on the console for debugging purpose. The default value is 1.

Returns:
int debug level

getFileAccessType

public int getFileAccessType()
Gets the fileAccessType property value.

Returns:
File access type for the database file. Possible return values are:
  • FILEACCESS_KEYED
  • FILEACCESS_SEQUENTIAL
See Also:
setFileAccessType(int)

getFileName

public String getFileName()
Gets the fileName property value.

Returns:
name of the database file.
See Also:
setFileName(java.lang.String)

getHasFileBeenOpened

protected boolean getHasFileBeenOpened()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getJournal

public String getJournal()
Gets the journal property value.

Returns:
name of the journal.
See Also:
setJournal(java.lang.String)

getJournalLibrary

public String getJournalLibrary()
Gets the JournalLibrary property value.

Returns:
Library name of the journal.
See Also:
setJournalLibrary(java.lang.String)

getLibrary

public String getLibrary()
Gets the library property value.

Returns:
library name of the database file.
See Also:
setLibrary(java.lang.String)

getNKeyFields

protected int getNKeyFields()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getOpenType

public int getOpenType()
Gets the openType property value.

Returns:
Open type for the database file. Possible return values are:
  • OPENTYPE_READ_WRITE
  • OPENTYPE_READ_ONLY
See Also:
setOpenType(int)

getPacketSize

public int getPacketSize()
Gets the packetSize property value.

Returns:
The packetSize property value.
See Also:
setPacketSize(int)

getPassword

public String getPassword()
Gets the password od userid to logon to the server specified in property server.

Returns:
The password.
See Also:
setPassword(java.lang.String)

getPropertyChange

protected PropertyChangeSupport getPropertyChange()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getReadingAll

protected boolean getReadingAll()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getRecFormatStringList

protected ArrayList getRecFormatStringList()
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


getRecIOMgrClassName

public String getRecIOMgrClassName()
Gets the recIOMgrClassName property value, i.e. the name of the RecordIOManager serialized data class.

Returns:
java.lang.String
See Also:
setRecIOMgrClassName(java.lang.String)

getRecIOMgrExtendedName

public String getRecIOMgrExtendedName()
Gets the recIOMgrExtendedName property value, i.e. the extended class name of the RecordIOManager serialized data class with package name, e.g. com.ibm.ivj.examples.et400.dfubeans.ModelNoCond.

Returns:
java.lang.String

getRecIOMgrPackageName

public String getRecIOMgrPackageName()
Gets the recIOMgrPackageName property value, i.e. the package of the RecordIOManager serialized data class.

Returns:
java.lang.String

getRecordFormat

public RecordFormat getRecordFormat()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Gets the record format of the database file specified by property recordFormatName.

Returns:
com.ibm.as400.access.RecordFormat
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

getRecordFormatName

public String getRecordFormatName()
Gets the recordFormatName property value, i.e. the name of the record format of the database file.

Returns:
java.lang.String
See Also:
setRecordFormatName(java.lang.String)

getResource

public ResourceBundle getResource()
Return resource bundle.

Returns:
com.ibm.etools.iseries.ui.ListResourceBundle

getResultSetTableModel

public DefaultTableModel getResultSetTableModel()
Gets the resultSetTableModel property value. The result set of the last operation.

Returns:
javax.swing.table.DefaultTableModel

getSelectedColumnNames

public ArrayList getSelectedColumnNames()
Gets the selectedColumnNames property value, i.e. all the fields names to work with in a record format. This is equivalent to the list shown in "selected columns" on the Columns page of the custom property editor.

Returns:
java.util.ArrayList
See Also:
setSelectedColumnNames(java.util.ArrayList)

getServer

public String getServer()
Gets the server property value.

Returns:
The name of the server or the IP address of the server.
See Also:
setServer(java.lang.String)

getSystem

public AS400 getSystem()
Gets the AS400 system object of the server specified in property server.

Returns:
The AS400 system object.
See Also:
setSystem(AS400)

getThreadUsed

public boolean getThreadUsed()
Gets the threadUsed property value. The default value is true. If your application needs to be compliant with the Enterprise Java Beans specification, you might want to set threadUsed to false.

Returns:
boolean
See Also:
setThreadUsed(boolean)

getUserid

public String getUserid()
Gets the user id to logon to the server specified in property server.

Returns:
The user id.
See Also:
setUserid(java.lang.String)

getVetoPropertyChange

protected VetoableChangeSupport getVetoPropertyChange()
Accessor for the vetoPropertyChange field.


handleException

protected void handleException(String messageHeader,
                               Throwable e)
Print a throwable exception to the console with a message header if debug is greater than 0.

Parameters:
messageHeader - java.lang.String
e - java.lang.Throwable

handleException

protected void handleException(Throwable e)
Prints the Throwable e and its backtrace to the standard error stream if debug is greater than 0.

Parameters:
e - java.lang.Throwable

isConditionValid

protected boolean isConditionValid(Record currentRecord)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


joinDataBase

public void joinDataBase(String[] foreignKeyNames,
                         RecordIOManager database)
To join the database file specified in property fileName and library, with another database file specified in another RecordIOManager object's fileName and library. Joined database files have to be in keyed file access.

Parameters:
foreignKeyNames - A string array that contains the name of the foreign keys, the field names that join the two database files together with equal values. In the example above, MODEL and PARTSHIP is the foreign keys of database file PRODDTL to join with file MODEL.
database - RecordIOManager object to be joined.

lockDatabase

public boolean lockDatabase(int lockType)
                     throws AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException
Obtains a lock on the database file. If the file is not open, method openFile will be called automatically and apply the lock.

Parameters:
lockType - Valid lock values are:
  • LOCK_READ_EXCLUSIVE
  • LOCK_READ_ALLOW_SHARED_READ
  • LOCK_READ_ALLOW_SHARED_WRITE
  • LOCK_WRITE_EXCLUSIVE
  • LOCK_WRITE_ALLOW_SHARED_READ
  • LOCK_WRITE_ALLOW_SHARED_WRITE
Returns:
True if lock applied successfully; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
openFile()

mapDataFieldNames

protected void mapDataFieldNames(Vector dfuCompVector)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


openFile

public boolean openFile()
                 throws AS400Exception,
                        AS400SecurityException,
                        InterruptedException,
                        IOException,
                        IllegalPathNameException
Opens a database file based on the property values of fileName, library, server, system, openType, fileAccessType, recordFormatName, commitLockLevel. If the commitLockLevel is not COMMITLOCKLEVEL_NONE, commitment control will be started before file is opened. If journal physical file is not started, command STRJRNPF will automatically be called prior starting commitment control. However, when the file is closed, end journal physical file will not automatically be ended. User has to explicitly end it by calling endJournalPhysicalFile(). If RecordIOManager is joined with another instance of RecordIOManager, then the database file specified in the joined RecordIOManager object will also be opened. The fileAccessType of joined files must be FILEACCESS_KEYED. The file cursor is positioned prior to the first record of the primary database file if property value of ascendingOrder is true; otherwise the file cursor is positioned after the last record of the primary database file.

openType can only be OPENTYPE_READ_WRITE or OPENTYPE_READ_ONLY, cannot be a write only type.

If fileAccessType is FILEACCESS_SEQUENTIAL, no actions will be taken for all the methods that require key access, e.g. positionCursor(String[] keyValues).

Returns:
True if file is opened successfully; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
com.ibm.as400.access.IllegalPathNameException - Indicates that the integrated file system path name is not valid.
AS400Exception
AS400SecurityException
InterruptedException
IOException
IllegalPathNameException
See Also:
closeFile()

positionCursor

public boolean positionCursor(String[] keyValues)
                       throws AS400Exception,
                              AS400SecurityException,
                              InterruptedException,
                              IOException
Position the cursor of the database file to the record with the specified keys. If the database file is not opened, it will be opened automatically prior to positioning the cursor. If the file access type is FILEACCESS_SEQUENTIAL, no action is taken when this method is invoked, the return value is false. This file operation does not affect resultSetTableModel.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record.
Returns:
True if cursor can be position to record with the specified keys; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursor

public boolean positionCursor(int recordNumber)
                       throws AS400Exception,
                              AS400SecurityException,
                              InterruptedException,
                              IOException
Position the cursor of the database file to the specified recordNumber. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Parameters:
recordNumber - The record number of the record to which cursor is positioned.
Returns:
True if cursor can be position to the specified recordNumber; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorAfterLast

public boolean positionCursorAfterLast()
                                throws AS400Exception,
                                       AS400SecurityException,
                                       InterruptedException,
                                       IOException
Positions the file cursor to after the last record. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Returns:
True if the file cursor can be positioned to after the last record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorBeforeFirst

public boolean positionCursorBeforeFirst()
                                  throws AS400Exception,
                                         AS400SecurityException,
                                         InterruptedException,
                                         IOException
Positions the file cursor to before the first record. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Returns:
True if the file cursor can be positioned to before the first record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorToFirst

public boolean positionCursorToFirst()
                              throws AS400Exception,
                                     AS400SecurityException,
                                     InterruptedException,
                                     IOException
Positions the cursor to the first record in the file. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Returns:
True if the file cursor can be positioned to the first record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorToLast

public boolean positionCursorToLast()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Positions the cursor to the last record in the file. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Returns:
True if the file cursor can be positioned to the last record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorToNext

public boolean positionCursorToNext()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Positions the cursor to the next record that satisfies the conditions determined in the isConditionValid() method of check condition class. This file operation does not affect resultSetTableModel. If the database file is not opened, it will be opened automatically prior to positioning the cursor.

Returns:
True if the file cursor can be positioned to the next record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

positionCursorToPrevious

public boolean positionCursorToPrevious()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        InterruptedException,
                                        IOException
Positions the cursor to the previous record that satisfies the conditions determined in the isConditionValid() method of check condition class. If the database file is not opened, it will be opened automatically prior to positioning the cursor. This file operation does not affect resultSetTableModel.

Returns:
True if the file cursor can be positioned to the previous record; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException

propertyChange

public void propertyChange(PropertyChangeEvent e)
Examine the PropertyChangeEvent and decides what to do on a particular event.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
e - java.beans.PropertyChangeEvent

readAllRecords

public DefaultTableModel readAllRecords()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        InterruptedException,
                                        IOException
Reads all the records that satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. If the database file is not opened, it will be opened automatically. User can terminate the read all records operation at any time by invoking cancelReadAllRecords method from a different thread. If the fileaccessType is FILEACCESS_KEYED, records will be retrieved by key order; otherwise records will be retrieved in sequential order.

Returns:
resultSetTableModel is a javax.swing.table.DefaultTableModel that has columns for each fields specified in property selectedColumnNames for all joined database files. It also has columns for the record numbers of each database file. A typical resultSetTableModel looks like the following:

ADTSLAB.PRODDTL._recordNumber ADTSLAB.PRODDTL.PARTNO ADTSLAB.PRODDTL.MODEL ADTSLAB.PRODDTL.PARTD ADTSLAB.PRODDTL.INVENTORY ADTSLAB.PRODDTL.PARTSHIP ADTSLAB.PRODDTL.PARTPIC ADTSLAB.MODEL._recordNumber ADTSLAB.MODEL.MODEL ADTSLAB.MODEL.PARTSHIP ADTSLAB.MODEL.MANUFACT ADTSLAB.MODEL.ADDRESS ADTSLAB.MODEL.CITY
234 00008 m8 Extension cord 80 2000-02-08 c:\abc\b 25 m8 2000-02-08 B Manufacturer 88 Main St. Markham
19 00015 m15 Adapter 150 2000-02-15 c:\abc\d 33 m15 2000-02-15 D Manufacturer 15 King St. Toronto
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
cancelReadAllRecords(), readFirstSetOfRecords(), readNextSetOfRecords()

readAllRecordsEqual

public DefaultTableModel readAllRecordsEqual(String[] keyValues)
                                      throws AS400Exception,
                                             AS400SecurityException,
                                             InterruptedException,
                                             IOException
Reads all the records that equal the specified keyValues and satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. If the database file is not opened, it will be opened automatically. If the fileaccessType is FILEACCESS_SEQUENTIAL, no action is taken, null will be returned.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The keyValues may be a partial key.
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords(), readRecord(String[])

readFirstSetOfRecords

public DefaultTableModel readFirstSetOfRecords()
                                        throws AS400Exception,
                                               AS400SecurityException,
                                               InterruptedException,
                                               IOException
Reads the first set of records that satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The size of the set of records returned is determined by the number specified in property packetSize. If the property value of ascendingOrder is true; records are read from the beginning of the file; otherwise records are read from the end of the file in descending order. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords()

readNextRecord

public DefaultTableModel readNextRecord()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        InterruptedException,
                                        IOException
Reads the next record that satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The search does not include the current record. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readPreviousRecord()

readNextRecordEqual

public DefaultTableModel readNextRecordEqual(String[] keyValues)
                                      throws AS400Exception,
                                             AS400SecurityException,
                                             InterruptedException,
                                             IOException
Reads the next record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The search does not include the current record. If the database file is not opened, it will be opened automatically. If the fileaccessType is FILEACCESS_SEQUENTIAL, no action is taken, null will be returned.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The keyValues may be a partial key.
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords(), readAllRecordsEqual(java.lang.String[]), readPreviousRecordEqual(java.lang.String[]), readRecord(String[])

readNextSetOfRecords

public DefaultTableModel readNextSetOfRecords()
                                       throws AS400Exception,
                                              AS400SecurityException,
                                              InterruptedException,
                                              IOException
Reads the next set of records from the current file cursor position, records retrieved has to satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The size of the set of records returned is determined by the number specified in property packetSize. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords()

readPreviousRecord

public DefaultTableModel readPreviousRecord()
                                     throws AS400Exception,
                                            AS400SecurityException,
                                            InterruptedException,
                                            IOException
Reads the previous record that satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The search does not include the current record. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readNextRecord()

readPreviousRecordEqual

public DefaultTableModel readPreviousRecordEqual(String[] keyValues)
                                          throws AS400Exception,
                                                 AS400SecurityException,
                                                 InterruptedException,
                                                 IOException
Reads the previous record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The search does not include the current record. If the database file is not opened, it will be opened automatically. If the fileaccessType is FILEACCESS_SEQUENTIAL, no action is taken, null will be returned.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The keyValues may be a partial key.
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecordsEqual(java.lang.String[]), readNextRecordEqual(java.lang.String[]), readRecord(String[])

readPreviousSetOfRecords

public DefaultTableModel readPreviousSetOfRecords()
                                           throws AS400Exception,
                                                  AS400SecurityException,
                                                  InterruptedException,
                                                  IOException
Reads the previous set of records from the current file cursor position, records retrieved has to satisfy the conditions determined in the isConditionValid() method of check condition class. The size of the set of records returned is determined by the number specified in property packetSize. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords()

readRecord

public DefaultTableModel readRecord()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Reads the next record from current file cursor position that satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. The search includes the current record. If the database file is not opened, it will be opened automatically.

Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readNextRecord()

readRecord

public DefaultTableModel readRecord(String[] keyValues)
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Reads the record whose key matches the specified key and satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys with the keys of the joined database file. If the database file is not opened, it will be opened automatically. If the fileaccessType is FILEACCESS_SEQUENTIAL, no action is taken, null will be returned.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The key may be a partial key. If the file contains FIELD1 CHAR(5) and FIELD2 CHAR(5) which are both key fields and which are both variable length, with the data:
 00000 ABCDE
 00001 FGHIJ
 00010 KLMNO
 00011 PQRST
 00100 UVWXY
 00101 ZZZZZ
 

Here's a table of outcomes you should expect for the command:

 Variable length field?   Key used    Result
 Yes                      "00001"     "00001 ABCDE"
 Yes                      "00010"     "00010 KLMNO"
 Yes                      "0001"      "00010 KLMNO"
 Yes                      "001"       "00100 UVWXY"
 
 No                       "00001"     "00001 ABCDE"
 No                       "00010"     "00010 KLMNO"
 No                       "0001"      "00100 UVWXY"
 No                       "001"       null (EOF reached, no record found)
 
If a field inside a record format is not declared to be variable length, then its contents will be padded to the length of the field definition. That is why "001" does not return any records if it is not variable length: the actual key being used is "001 ".
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords(), readAllRecordsEqual(java.lang.String[])

readRecord

public DefaultTableModel readRecord(String[] keyValues,
                                    int searchType)
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Reads the first record meeting the specified search criteria based on keyValues and satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, the search criteria also has to satisfy the matching of the foreign keys. If the database file is not opened, it will be opened automatically. If the fileaccessType is FILEACCESS_SEQUENTIAL, no action is taken, null will be returned.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The key may be a partial key.
searchType - Valid values are:
  • SEARCHTYPE_KEY_EQ
  • SEARCHTYPE_KEY_GE
  • SEARCHTYPE_KEY_GT
  • SEARCHTYPE_KEY_LE
  • SEARCHTYPE_KEY_LT
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readAllRecords(), readRecord(String[])

readRecord

public DefaultTableModel readRecord(int recordNumber)
                             throws AS400Exception,
                                    AS400SecurityException,
                                    InterruptedException,
                                    IOException
Reads the record with the specified recordNumber. This read does not have to satisfy the conditions determined in the isConditionValid() method of check condition class. If the database file is joined with another database file, matching of the foreign keys and the keys of the joined database file is ignored, only the record with the specified recordNumber from the primary database file is returned. If the database file is not opened, it will be opened automatically.

Parameters:
recordNumber - Record with this record number will be read.
Returns:
resultSetTableModel
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
readRecord(String[])

readRecordJoinDatabase

protected boolean readRecordJoinDatabase(String[] keyStringValues,
                                         int searchType,
                                         boolean writeData)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.


removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener l)
Removes a vetoableChangeListener.

Parameters:
l - java.beans.VetoableChangeListener

restoreInfoBlock

protected Object restoreInfoBlock(String methodName)
                           throws ClassNotFoundException,
                                  InstantiationException,
                                  IllegalAccessException,
                                  SerializedDataException,
                                  IOException
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.

Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
SerializedDataException
IOException

rollback

public void rollback()
              throws AS400Exception,
                     AS400SecurityException,
                     InterruptedException,
                     IOException
Rolls back any transactions since the last commit/rollback boundary. Invoking this method will cause all transactions under commitment control for this connection to be rolled back. This means that any database file for which a commit lock level was specified and that was opened under this connection will have outstanding transactions rolled back.

Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
commit()

setAscendingOrder

public void setAscendingOrder(boolean order)
Set the order of record retrieval.

Parameters:
ascendingOrder - True for ascending order, false for descending order.

setAvailableColumnStringList

protected void setAvailableColumnStringList(ArrayList availList)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setCheckConditionClassName

public void setCheckConditionClassName(String name)
Set the class name of the check condition class. User can define his/her own check condition class to filter records to retrieve. The check condition class must extends AbstractCondition, and must implements a method isConditionValid(com.ibm.as400.access.Record record), which returns a boolean value to determine if record is valid. If the return value of method isConditionValid is true, record is accepted; otherwise record is skipped.

Parameters:
name - Name of the check condition class.
See Also:
setCheckConditionPackageName(java.lang.String)

setCheckConditionPackageName

public void setCheckConditionPackageName(String name)
Set the package of which the check condition class belongs. User can define his/her own check condition class to filter records to retrieve. The check condition class must extends AbstractCondition, and must implements a method isConditionValid(com.ibm.as400.access.Record record), which returns a boolean value to determine if record is valid. If the return value of method isConditionValid is true, record is accepted; otherwise record is skipped.

Parameters:
name - Name of the package.
See Also:
setCheckConditionClassName(java.lang.String)

setCommitLockLevel

public void setCommitLockLevel(int commitLevel)
                        throws PropertyVetoException
Sets the commitLockLevel for the database file specified in property fileName and library. Commitment control is started prior to opening the database file.

Parameters:
commitLockLevel - Valid values are:
  • COMMITLOCKLEVEL_ALL
  • COMMITLOCKLEVEL_CHANGE
  • COMMITLOCKLEVEL_CURSOR_STABILITY
  • COMMITLOCKLEVEL_NONE
Throws:
PropertyVetoException
See Also:
getCommitLockLevel(), openFile()

setConditionChanged

protected void setConditionChanged(boolean value)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setConditionList

protected void setConditionList(ArrayList l)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setDebugLevel

public void setDebugLevel(int value)
Sets the debugLevel property value.

Parameters:
value -
  • 0 - no exceptions nor messages will be dumped on the console for debugging purpose.
  • 1 - only exceptions will be dumped on the console.
  • 2 - exceptions, error and informational messages will be dumped on the console.
See Also:
getDebugLevel()

setDfuComponentVector

protected void setDfuComponentVector(Vector v)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setFileAccessType

public void setFileAccessType(int type)
                       throws PropertyVetoException
Sets the fileAccessType property value.

Parameters:
type - Valid values are:
  • FILEACCESS_KEYED
  • FILEACCESS_SEQUENTIAL
Throws:
PropertyVetoException
See Also:
getFileAccessType()

setFileName

public void setFileName(String file)
                 throws PropertyVetoException
Sets the fileName property value.

Parameters:
file - Name of the database file.
Throws:
PropertyVetoException
See Also:
getFileName()

setJournal

public void setJournal(String journalName)
                throws PropertyVetoException
Sets the journal property value.

Parameters:
journalName - Name of the journal.
Throws:
PropertyVetoException
See Also:
getJournal()

setJournalLibrary

public void setJournalLibrary(String library)
                       throws PropertyVetoException
Gets the journalLibrary property value.

Parameters:
library - Name of the library where the journal resides.
Throws:
PropertyVetoException
See Also:
getJournalLibrary()

setLibrary

public void setLibrary(String lib)
                throws PropertyVetoException
Sets the library property value.

Parameters:
lib - Library name of the database file.
Throws:
PropertyVetoException
See Also:
getLibrary()

setOpenType

public void setOpenType(int type)
                 throws PropertyVetoException
Sets the openType property (int) value.

Parameters:
type - Open type for the database file. Valid values are:
  • OPENTYPE_READ_WRITE
  • OPENTYPE_READ_ONLY
Throws:
PropertyVetoException
See Also:
getOpenType()

setPacketSize

public void setPacketSize(int size)
                   throws PropertyVetoException
Sets the packetSize property (int) value.

Parameters:
packetSize - Number of records to retrieve at a time in methods readFirstSetOfRecords, readNextSetOfRecords and readPreviousSetOfRecords.
Throws:
PropertyVetoException
See Also:
getPacketSize(), readFirstSetOfRecords(), readNextSetOfRecords(), readPreviousSetOfRecords()

setPassword

public void setPassword(String pwd)
                 throws PropertyVetoException
Sets the password of userid to logon to the server specified in property server.

Parameters:
pwd - The Password.
Throws:
PropertyVetoException
See Also:
getPassword()

setPrimaryDatabase

protected void setPrimaryDatabase(boolean value)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setReadingAll

protected void setReadingAll(boolean value)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setRecFormatStringList

protected void setRecFormatStringList(ArrayList rf)
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.


setRecIOMgrClassName

public void setRecIOMgrClassName(String name)
Sets the recIOMgrClassName property value. The name of the class that stores the serialized data of the current RecordIOManager object.

Parameters:
name - Name of the RecordIOManager serialized data class.
See Also:
getRecIOMgrClassName()

setRecIOMgrPackageName

public void setRecIOMgrPackageName(String name)
Sets the recIOMgrPackageName property value. The package name of the class that stores the serialized data of the current RecordIOManager object.

Parameters:
name - Package name of the RecordIOManager serialized data class.
See Also:
getRecIOMgrClassName()

setRecordFormatName

public void setRecordFormatName(String name)
                         throws PropertyVetoException
Sets the record format name of the database file.

Parameters:
name - Name of the record format.
Throws:
PropertyVetoException
See Also:
getRecordFormatName()

setResultSetTableModel

public void setResultSetTableModel(DefaultTableModel model)
Set the DefaultTableModel used for result set.

Parameters:
model - javax.swing.table.DefaultTableModel

setSelectedColumnNames

public void setSelectedColumnNames(ArrayList names)
Sets the selectedColumnNames property value,

Parameters:
names - A list of strings (java.lang.String) contains all the fields names to work with in a record format. This is equivalent to the list shown in "selected columns" on the Columns page of the custom property editor.
See Also:
getSelectedColumnNames()

setServer

public void setServer(String s)
Sets the server property value.

Parameters:
s - Name of the server or the IP address of the server.
See Also:
getServer()

setSystem

public void setSystem(AS400 sys)
Sets the system property value. If system is set, system has preference over the values set for server, userid and password; and sys's threadUsed will be used to determine if threading is allowed.

Parameters:
system - The com.ibm.as400.access.AS400 system object of the server specified in property server.
See Also:
getSystem()

setThreadUsed

public void setThreadUsed(boolean useThreads)
Sets whether the bean uses threads in communication with the host servers. The default is true. Letting the bean use threads may be beneficial to performance, turning threads off may be necessary if your application needs to be compliant with the Enterprise Java Beans specification. The thread used property cannot be changed once a connection to the AS/400 has been established. If there is a call to setSystem(AS400 as400), the threadUsed value of system as400 will be used instead, and this useThreads value will be ignored.

Parameters:
useThreads - - true to use threads; false otherwise.
See Also:
getThreadUsed()

setUserid

public void setUserid(String id)
               throws PropertyVetoException
Sets the user id to logon to the server specified in property server.

Parameters:
id - The user id.
Throws:
PropertyVetoException
See Also:
getUserid()

startJournalPhysicalFile

public boolean startJournalPhysicalFile()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        InterruptedException,
                                        IOException,
                                        ErrorCompletingRequestException,
                                        ExtendedIllegalStateException
The method will call STRJRNPF command on the AS/400 server to start a journal physical file specified in property journal and journalLibrary.

Returns:
True if the journal physical file is started successfully; false otherwise.
Throws:
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
com.ibm.as400.access.ErrorCompletingRequestException - If an error occurs before the request is completed.
com.ibm.as400.access.ExtendedIllegalStateException - An object is not in the proper state to perform the requested operation.
AS400Exception
AS400SecurityException
InterruptedException
IOException
ErrorCompletingRequestException
ExtendedIllegalStateException
See Also:
endJournalPhysicalFile()

updateRecord

protected boolean updateRecord(int[] recordNumbers,
                               Vector fieldDataVector)
                        throws RecordNotFoundException,
                               AS400Exception,
                               AS400SecurityException,
                               InterruptedException,
                               IOException,
                               InvalidFieldDataException
User should never use this method, unexpected result may occur. This method is only to be invoked by classes within the same package internally.

Throws:
RecordNotFoundException
AS400Exception
AS400SecurityException
InterruptedException
IOException
InvalidFieldDataException
See Also:
updateRecord(int[], DefaultTableModel)

updateRecord

public boolean updateRecord(int[] recordNumbers,
                            DefaultTableModel tableModel)
                     throws RecordNotFoundException,
                            AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException,
                            InvalidFieldDataException
Update a record in the database file. If the file is not opened when invoking this method, openFile() will be called automatically. To invoke this method, the file access type can be FILEACCESS_KEYED or FILEACCESS_SEQUENTIAL.

Parameters:
recordNumbers - An array of int. The first int element represents the record number of the record to be update in the primary database file, the second int element represent the record number of the record to be update in the joined database file, the third int element represent the record number of the record to be update in next joined database file, and so forth. If the database file is not joined, then only need to specify an array of one element.
tableModel - A DefaultTableModel to hold the data of a record. The header of each column in the tableModel has to be in the format of library.fileName.fieldName, e.g. for field PARTNO in file PRODDTL in library ADTSLAB, then the header should be ADTSLAB.PRODDTL.PARTNO. Data of each field should be placed in the appropriate column. Only the first row of data in the tableModel will be updated in the database. If the database is joined with another database, then tableModel can have fields from both databases, and record number specified in parameter recordNumbers for both database files will be updated. The following is an example of how a tableModel can look like:
ADTSLAB.PRODDTL.PARTNO ADTSLAB.PRODDTL.MODEL ADTSLAB.PRODDTL.PARTD ADTSLAB.PRODDTL.INVENTORY ADTSLAB.PRODDTL.PARTSHIP ADTSLAB.PRODDTL.PARTPIC ADTSLAB.MODEL.MODEL ADTSLAB.MODEL.PARTSHIP ADTSLAB.MODEL.MANUFACT ADTSLAB.MODEL.ADDRESS ADTSLAB.MODEL.CITY
00015 m15 Adapter 150 2000-02-15 c:\abc\d m15 2000-02-15 D Manufacturer 15 King St. Toronto

This tableModel has data for two databases, updateRecord method will update the record specified in recordNumbers[0] in database file PRODDTL, and update the record specified in recordNumbers[1] in database file MODEL, provided that the two database files are joined. The order of the columns in the tableModel does not make a difference. If a field is missing from the tableModel, the original value of the field in the record is retained.

Returns:
True will be returned if the record is updated successfully; false otherwise.
Throws:
RecordNotFoundException - Records with the specified recordNumbers are not found.
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
InvalidFieldDataException - Invalid data in one or more fields.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
updateRecord(int[], Vector)

updateRecord

public boolean updateRecord(DefaultTableModel tableModel)
                     throws RecordNotFoundException,
                            AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException,
                            InvalidFieldDataException
Update a record in the database file. This method is not designed to update joined database files, it can only update a single database file. If the file is not opened when invoking this method, openFile() will be called automatically. To invoke this method, the file access type can be FILEACCESS_KEYED or FILEACCESS_SEQUENTIAL.

Parameters:
tableModel - A DefaultTableModel to hold the data of a record. The header of each column in the tableModel has to be in the format of library.fileName.fieldName, e.g. for field PARTNO in file PRODDTL in library ADTSLAB, then the header should be ADTSLAB.PRODDTL.PARTNO. Data of each field should be placed in the appropriate column. One of the column should be library.filename._recordNumber, e.g. ADTSLAB.PRODDTL._recordNumber, which holds the record number of the record that you want to update. If you have performed a read, you can reuse the DefaultTableModel that is returned from the read operation, and simply update the columns that need changes and pass it to this method, then the record that you have read will be updated with the new values. Only the first row of data in the tableModel will be updated in the database. The following is an example of how a tableModel can look like:
ADTSLAB.PRODDTL._recordNumber ADTSLAB.PRODDTL.PARTNO ADTSLAB.PRODDTL.MODEL ADTSLAB.PRODDTL.PARTD ADTSLAB.PRODDTL.INVENTORY ADTSLAB.PRODDTL.PARTSHIP ADTSLAB.PRODDTL.PARTPIC
2 00015 m15 Adapter 150 2000-02-15 c:\abc\d
The order of the columns in the tableModel does not make a difference. If a field is missing from the tableModel, the original value of the field in the record is retained. Only the columns in the tableModel are updated.
Returns:
True will be returned if the record is updated successfully; false otherwise.
Throws:
RecordNotFoundException - Records with the specified recordNumbers are not found.
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
InvalidFieldDataException - Invalid data in one or more fields.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
updateRecord(String[], DefaultTableModel), updateRecord(int[], DefaultTableModel)

updateRecord

public boolean updateRecord(String[] keyValues,
                            DefaultTableModel tableModel)
                     throws RecordNotFoundException,
                            AS400Exception,
                            AS400SecurityException,
                            InterruptedException,
                            IOException,
                            InvalidFieldDataException
Update a record in the database file by keys. This method is not designed to update duplicate key files, it can only update a single database file with unique keys. To update record with duplicate key values, use method updateRecord(int[], DefaultTableModel). If the file is not opened when invoking this method, openFile() will be called automatically. To invoke this method, the file access type can be FILEACCESS_KEYED or FILEACCESS_SEQUENTIAL. It will implicitly perform a read with the specified keys to locate the record, then update the record with the values specified in tableModel.

Parameters:
keyValues - The String array that contains the string values which make up the key with which to find the record. The key may be a partial key. See readRecord(String[]) method for details.
tableModel - A DefaultTableModel to hold the data of a record. The header of each column in the tableModel has to be in the format of library.fileName.fieldName, e.g. for field PARTNO in file PRODDTL in library ADTSLAB, then the header should be ADTSLAB.PRODDTL.PARTNO. Data of each field should be placed in the appropriate column. Only the first row of data in the tableModel will be updated in the database. The following is an example of how a tableModel can look like:
ADTSLAB.PRODDTL.PARTNO ADTSLAB.PRODDTL.MODEL ADTSLAB.PRODDTL.PARTD ADTSLAB.PRODDTL.INVENTORY ADTSLAB.PRODDTL.PARTSHIP ADTSLAB.PRODDTL.PARTPIC
2 00015 m15 Adapter 150 2000-02-15 c:\abc\d
The order of the columns in the tableModel does not make a difference. If a field is missing from the tableModel, the original value of the field in the record is retained. Only the columns in the tableModel are updated.
Returns:
True will be returned if the record is updated successfully; false otherwise.
Throws:
RecordNotFoundException - Records with the specified recordNumbers are not found.
com.ibm.as400.access.AS400Exception - If the AS/400 system returns an error message.
com.ibm.as400.access.AS400SecurityException - If a security or authority error occurs.
com.ibm.as400.access.InterruptedException - If this thread is interrupted.
com.ibm.as400.access.IOException - If an error occurs while communicating with the AS/400.
InvalidFieldDataException - Invalid data in one or more fields.
AS400Exception
AS400SecurityException
InterruptedException
IOException
See Also:
updateRecord(DefaultTableModel), updateRecord(int[], DefaultTableModel)

vetoableChange

public void vetoableChange(PropertyChangeEvent e)
                    throws PropertyVetoException
This method gets called when a constrained property is changed.

Specified by:
vetoableChange in interface VetoableChangeListener
Parameters:
e - java.beans.PropertyChangeEvent a PropertyChangeEvent object describing the event source and the property that has changed.
Throws:
PropertyVetoException - if the recipient wishes the property change to be rolled back.

getRecNum

public int getRecNum()

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.