|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.DataArea | +--com.ibm.as400.access.LocalDataArea
The LocalDataArea class represents a local data area on the AS/400.
A local data area exists as a character data area on the AS/400. It is automatically associated with a job and cannot be accessed from another job; hence, it cannot be directly created or deleted by the user.
Care must be taken when using local data areas so that the server job is not ended prematurely. When the job ends, its local data area is automatically deleted, at which point the LocalDataArea object that is referencing it will no longer be valid.
The following example demonstrates the use of LocalDataArea:
// Prepare to work with the AS/400 system named "My400". AS400 system = new AS400("My400"); // Create a LocalDataArea object to access // the local data area associated with this connection. LocalDataArea dataArea = new LocalDataArea(system); // Clear the data area dataArea.clear(); // Write to the data area dataArea.write("Hello world"); // Read from the data area String data = dataArea.read();
Constructor Summary | |
LocalDataArea()
Constructs a LocalDataArea object. |
|
LocalDataArea(AS400 system)
Constructs a LocalDataArea object. |
Method Summary | |
void |
clear()
Resets the data area to contain all blanks. |
java.lang.String |
read()
Reads the data from the data area. |
java.lang.String |
read(int type)
Reads the data from the data area. |
java.lang.String |
read(int dataAreaOffset,
int dataLength)
Reads the data from the data area. |
java.lang.String |
read(int dataAreaOffset,
int dataLength,
int type)
Reads the data from the data area. |
void |
write(java.lang.String data)
Writes the data to the data area. |
void |
write(java.lang.String data,
int dataAreaOffset)
Writes the data to the data area. |
void |
write(java.lang.String data,
int dataAreaOffset,
int type)
Writes the data to the data area. |
Methods inherited from class com.ibm.as400.access.DataArea |
addDataAreaListener, addPropertyChangeListener, addVetoableChangeListener, getLength, getName, getSystem, refreshAttributes, removeDataAreaListener, removePropertyChangeListener, removeVetoableChangeListener, setSystem |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalDataArea()
public LocalDataArea(AS400 system)
system
- The AS/400 that contains the data area.Method Detail |
public void clear() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.ServerStartupException
- If the AS/400 server cannot be started.java.net.UnknownHostException
- If the AS/400 system cannot be located.public java.lang.String read() throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.IllegalObjectTypeException
- If the AS/400 object is not the required type.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public java.lang.String read(int type) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
type
- The Local Data Area bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.IllegalObjectTypeException
- If the AS/400 object is not the required type.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public java.lang.String read(int dataAreaOffset, int dataLength) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataAreaOffset
- The offset in the data area at which to start reading.dataLength
- The number of characters to read. Valid values are from
1 through (data area size - dataAreaOffset).AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.IllegalObjectTypeException
- If the AS/400 object is not the required type.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public java.lang.String read(int dataAreaOffset, int dataLength, int type) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
dataAreaOffset
- The offset in the data area at which to start reading.dataLength
- The number of characters to read. Valid values are from
1 through (data area size - dataAreaOffset).type
- The Data Area bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.IllegalObjectTypeException
- If the AS/400 object is not the required type.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void write(java.lang.String data) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
data
- The data to be written.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.ServerStartupException
- If the AS/400 server cannot be started.java.net.UnknownHostException
- If the AS/400 system cannot be located.public void write(java.lang.String data, int dataAreaOffset) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
data
- The data to be written.dataAreaOffset
- The offset in the data area at which to start writing.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.ServerStartupException
- If the AS/400 server cannot be started.java.net.UnknownHostException
- If the AS/400 system cannot be located.public void write(java.lang.String data, int dataAreaOffset, int type) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
data
- The data to be written.dataAreaOffset
- The offset in the data area at which to start writing.type
- The Data Area bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.ServerStartupException
- If the AS/400 server cannot be started.java.net.UnknownHostException
- If the AS/400 system cannot be located.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |