|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.ui.RecordIOManager
public class RecordIOManager
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:
AbstractCondition
,
FormManager
,
ListManager
,
Serialized FormField 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 |
---|
public static final String Copyright
public static final int FILEACCESS_KEYED
openFile()
,
Constant Field Valuespublic static final int FILEACCESS_SEQUENTIAL
openFile()
,
Constant Field Valuespublic static final int SEARCHTYPE_KEY_EQ
public static final int SEARCHTYPE_KEY_GE
public static final int SEARCHTYPE_KEY_GT
public static final int SEARCHTYPE_KEY_LE
public static final int SEARCHTYPE_KEY_LT
public static final int OPENTYPE_READ_WRITE
openFile()
public static final int OPENTYPE_READ_ONLY
openFile()
public static final int COMMITLOCKLEVEL_ALL
openFile()
public static final int COMMITLOCKLEVEL_CHANGE
openFile()
public static final int COMMITLOCKLEVEL_CURSOR_STABILITY
openFile()
public static final int COMMITLOCKLEVEL_NONE
openFile()
public static final int LOCK_READ_EXCLUSIVE
lockDatabase(int)
public static final int LOCK_READ_ALLOW_SHARED_READ
lockDatabase(int)
public static final int LOCK_READ_ALLOW_SHARED_WRITE
lockDatabase(int)
public static final int LOCK_WRITE_EXCLUSIVE
lockDatabase(int)
public static final int LOCK_WRITE_ALLOW_SHARED_READ
lockDatabase(int)
public static final int LOCK_WRITE_ALLOW_SHARED_WRITE
lockDatabase(int)
public static final String methodName
protected transient PropertyChangeSupport propertyChange
protected transient VetoableChangeSupport vetoPropertyChange
Constructor Detail |
---|
public RecordIOManager()
public RecordIOManager(String recIOMgrSpecClassName)
recIOMgrSpecClassName
- full name of the RecordIOManager
serialized data class, e.g.
com.ibm.ivj.examples.et400.dfubeans.ModelNoCond.public RecordIOManager(String filename, String library) throws PropertyVetoException
filename
- Name of a physical or logical file.library
- Name of the library where the database file resides
PropertyVetoException
public RecordIOManager(String server, String userid, String password, String filename, String library) throws PropertyVetoException
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
PropertyVetoException
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
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:
openType
- File open type, valid values are:
packetSize
- Number of records to be read in a packet. To be
used by methods: readFirstSetOfRecords, readNextSetOfRecords, and
readPreviousSetOfRecords.commitLockLevel
- int
journal
- Name of the journaljournalLibrary
- Name of the library where the journal resides.
PropertyVetoException
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
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:
openType
- File open type, valid values are:
packetSize
- Number of records to be read in a packet. To be
used by methods: readFirstSetOfRecords, readNextSetOfRecords, and
readPreviousSetOfRecords.commitLockLevel
- int
journal
- Name of the journaljournalLibrary
- 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.
PropertyVetoException
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
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:
openType
- File open type, valid values are:
packetSize
- Number of records to be read in a packet. To be
used by methods: readFirstSetOfRecords, readNextSetOfRecords, and
readPreviousSetOfRecords.commitLockLevel
- int
journal
- Name of the journaljournalLibrary
- 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.
PropertyVetoException
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
protected boolean addRecord(Vector fieldDataVector) throws AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
AS400Exception
AS400SecurityException
InterruptedException
IOException
InvalidFieldDataException
addRecord(DefaultTableModel)
public boolean addRecord(DefaultTableModel tableModel) throws AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
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 |
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
addRecord(Vector)
public void addVetoableChangeListener(VetoableChangeListener l)
l
- java.beans.VetoableChangeListenerpublic void cancelReadAllRecords()
readAllRecords()
public Object clone()
clone
in class Object
public void closeFile() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
openFile()
public void commit() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
rollback()
public void connect() throws AS400SecurityException, IOException
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
disconnect()
public static String Copyright()
public TableModel dataOnlyResultSetTableModel(DefaultTableModel resultSetTableModel)
resultSetTableModel
- returned from methods such as readAllRecords,
readNextRecord, etc.
public boolean deleteRecord(int[] recordNumbers) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException
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.
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
public boolean deleteRecord(String[] keyValues) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException
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.
RecordNotFoundException
AS400Exception
AS400SecurityException
InterruptedException
IOException
public void disconnect() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
connect()
protected void doHookConnect()
public boolean endJournalPhysicalFile() throws AS400Exception, AS400SecurityException, InterruptedException, IOException, ErrorCompletingRequestException, ExtendedIllegalStateException
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
startJournalPhysicalFile()
public boolean getAscendingOrder()
setAscendingOrder(boolean)
protected ArrayList getAvailableColumnStringList()
public String getCheckConditionClassName()
setCheckConditionClassName(java.lang.String)
public String getCheckConditionExtendedName()
public String getCheckConditionPackageName()
public int getCommitLockLevel()
setCommitLockLevel(int)
protected boolean getConditionChanged()
protected ArrayList getConditionList()
protected String getDatafileName()
public int getDebugLevel()
public int getFileAccessType()
setFileAccessType(int)
public String getFileName()
setFileName(java.lang.String)
protected boolean getHasFileBeenOpened()
public String getJournal()
setJournal(java.lang.String)
public String getJournalLibrary()
setJournalLibrary(java.lang.String)
public String getLibrary()
setLibrary(java.lang.String)
protected int getNKeyFields()
public int getOpenType()
setOpenType(int)
public int getPacketSize()
setPacketSize(int)
public String getPassword()
setPassword(java.lang.String)
protected PropertyChangeSupport getPropertyChange()
protected boolean getReadingAll()
protected ArrayList getRecFormatStringList()
public String getRecIOMgrClassName()
setRecIOMgrClassName(java.lang.String)
public String getRecIOMgrExtendedName()
public String getRecIOMgrPackageName()
public RecordFormat getRecordFormat() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public String getRecordFormatName()
setRecordFormatName(java.lang.String)
public ResourceBundle getResource()
public DefaultTableModel getResultSetTableModel()
public ArrayList getSelectedColumnNames()
setSelectedColumnNames(java.util.ArrayList)
public String getServer()
setServer(java.lang.String)
public AS400 getSystem()
setSystem(AS400)
public boolean getThreadUsed()
setThreadUsed(boolean)
public String getUserid()
setUserid(java.lang.String)
protected VetoableChangeSupport getVetoPropertyChange()
protected void handleException(String messageHeader, Throwable e)
messageHeader
- java.lang.Stringe
- java.lang.Throwableprotected void handleException(Throwable e)
e
- java.lang.Throwableprotected boolean isConditionValid(Record currentRecord)
public void joinDataBase(String[] foreignKeyNames, RecordIOManager database)
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.public boolean lockDatabase(int lockType) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
lockType
- Valid lock values are:
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
openFile()
protected void mapDataFieldNames(Vector dfuCompVector)
public boolean openFile() throws AS400Exception, AS400SecurityException, InterruptedException, IOException, IllegalPathNameException
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).
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
closeFile()
public boolean positionCursor(String[] keyValues) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
keyValues
- The String array that contains the string values
which make up the key with which to find the record.
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
public boolean positionCursor(int recordNumber) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
recordNumber
- The record number of the record to which
cursor is positioned.
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
public boolean positionCursorAfterLast() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public boolean positionCursorBeforeFirst() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public boolean positionCursorToFirst() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public boolean positionCursorToLast() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public boolean positionCursorToNext() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public boolean positionCursorToPrevious() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
e
- java.beans.PropertyChangeEventpublic DefaultTableModel readAllRecords() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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 |
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
cancelReadAllRecords()
,
readFirstSetOfRecords()
,
readNextSetOfRecords()
public DefaultTableModel readAllRecordsEqual(String[] keyValues) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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.
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
readAllRecords()
,
readRecord(String[])
public DefaultTableModel readFirstSetOfRecords() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readAllRecords()
public DefaultTableModel readNextRecord() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readPreviousRecord()
public DefaultTableModel readNextRecordEqual(String[] keyValues) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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.
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
readAllRecords()
,
readAllRecordsEqual(java.lang.String[])
,
readPreviousRecordEqual(java.lang.String[])
,
readRecord(String[])
public DefaultTableModel readNextSetOfRecords() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readAllRecords()
public DefaultTableModel readPreviousRecord() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readNextRecord()
public DefaultTableModel readPreviousRecordEqual(String[] keyValues) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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.
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
readAllRecordsEqual(java.lang.String[])
,
readNextRecordEqual(java.lang.String[])
,
readRecord(String[])
public DefaultTableModel readPreviousSetOfRecords() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readAllRecords()
public DefaultTableModel readRecord() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
readNextRecord()
public DefaultTableModel readRecord(String[] keyValues) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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 ".
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
readAllRecords()
,
readAllRecordsEqual(java.lang.String[])
public DefaultTableModel readRecord(String[] keyValues, int searchType) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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:
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
readAllRecords()
,
readRecord(String[])
public DefaultTableModel readRecord(int recordNumber) throws AS400Exception, AS400SecurityException, InterruptedException, IOException
recordNumber
- Record with this record number will be read.
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
readRecord(String[])
protected boolean readRecordJoinDatabase(String[] keyStringValues, int searchType, boolean writeData)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removeVetoableChangeListener(VetoableChangeListener l)
l
- java.beans.VetoableChangeListenerprotected Object restoreInfoBlock(String methodName) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SerializedDataException, IOException
ClassNotFoundException
InstantiationException
IllegalAccessException
SerializedDataException
IOException
public void rollback() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
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
commit()
public void setAscendingOrder(boolean order)
ascendingOrder
- True for ascending order,
false for descending order.protected void setAvailableColumnStringList(ArrayList availList)
public void setCheckConditionClassName(String name)
name
- Name of the check condition class.setCheckConditionPackageName(java.lang.String)
public void setCheckConditionPackageName(String name)
name
- Name of the package.setCheckConditionClassName(java.lang.String)
public void setCommitLockLevel(int commitLevel) throws PropertyVetoException
commitLockLevel
- Valid values are:
PropertyVetoException
getCommitLockLevel()
,
openFile()
protected void setConditionChanged(boolean value)
protected void setConditionList(ArrayList l)
public void setDebugLevel(int value)
value
- getDebugLevel()
protected void setDfuComponentVector(Vector v)
public void setFileAccessType(int type) throws PropertyVetoException
type
- Valid values are:
PropertyVetoException
getFileAccessType()
public void setFileName(String file) throws PropertyVetoException
file
- Name of the database file.
PropertyVetoException
getFileName()
public void setJournal(String journalName) throws PropertyVetoException
journalName
- Name of the journal.
PropertyVetoException
getJournal()
public void setJournalLibrary(String library) throws PropertyVetoException
library
- Name of the library where the journal resides.
PropertyVetoException
getJournalLibrary()
public void setLibrary(String lib) throws PropertyVetoException
lib
- Library name of the database file.
PropertyVetoException
getLibrary()
public void setOpenType(int type) throws PropertyVetoException
type
- Open type for the database file.
Valid values are:
PropertyVetoException
getOpenType()
public void setPacketSize(int size) throws PropertyVetoException
packetSize
- Number of records to retrieve at a time in
methods readFirstSetOfRecords, readNextSetOfRecords and
readPreviousSetOfRecords.
PropertyVetoException
getPacketSize()
,
readFirstSetOfRecords()
,
readNextSetOfRecords()
,
readPreviousSetOfRecords()
public void setPassword(String pwd) throws PropertyVetoException
pwd
- The Password.
PropertyVetoException
getPassword()
protected void setPrimaryDatabase(boolean value)
protected void setReadingAll(boolean value)
protected void setRecFormatStringList(ArrayList rf)
public void setRecIOMgrClassName(String name)
name
- Name of the RecordIOManager serialized data class.getRecIOMgrClassName()
public void setRecIOMgrPackageName(String name)
name
- Package name of the RecordIOManager serialized data class.getRecIOMgrClassName()
public void setRecordFormatName(String name) throws PropertyVetoException
name
- Name of the record format.
PropertyVetoException
getRecordFormatName()
public void setResultSetTableModel(DefaultTableModel model)
model
- javax.swing.table.DefaultTableModelpublic void setSelectedColumnNames(ArrayList names)
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.getSelectedColumnNames()
public void setServer(String s)
s
- Name of the server or the IP address of the server.getServer()
public void setSystem(AS400 sys)
system
- The com.ibm.as400.access.AS400 system object of the server specified in property server.getSystem()
public void setThreadUsed(boolean useThreads)
useThreads
- - true to use threads; false otherwise.getThreadUsed()
public void setUserid(String id) throws PropertyVetoException
id
- The user id.
PropertyVetoException
getUserid()
public boolean startJournalPhysicalFile() throws AS400Exception, AS400SecurityException, InterruptedException, IOException, ErrorCompletingRequestException, ExtendedIllegalStateException
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
endJournalPhysicalFile()
protected boolean updateRecord(int[] recordNumbers, Vector fieldDataVector) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
RecordNotFoundException
AS400Exception
AS400SecurityException
InterruptedException
IOException
InvalidFieldDataException
updateRecord(int[], DefaultTableModel)
public boolean updateRecord(int[] recordNumbers, DefaultTableModel tableModel) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
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.
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
updateRecord(int[], Vector)
public boolean updateRecord(DefaultTableModel tableModel) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
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 |
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
updateRecord(String[], DefaultTableModel)
,
updateRecord(int[], DefaultTableModel)
public boolean updateRecord(String[] keyValues, DefaultTableModel tableModel) throws RecordNotFoundException, AS400Exception, AS400SecurityException, InterruptedException, IOException, InvalidFieldDataException
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 |
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
updateRecord(DefaultTableModel)
,
updateRecord(int[], DefaultTableModel)
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
e
- java.beans.PropertyChangeEvent a PropertyChangeEvent object describing the event source and the property that has changed.
PropertyVetoException
- if the recipient wishes the property change to be rolled back.public int getRecNum()
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |