|
|||||||||
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.CharacterDataArea
The CharacterDataArea class represents a character data area on the AS/400.
The following example demonstrates the use of CharacterDataArea:
// Prepare to work with the AS/400 system named "My400". AS400 system = new AS400("My400"); // Create a CharacterDataArea object. QSYSObjectPathName path = new QSYSObjectPathName("MYLIB", "MYDATA", "DTAARA"); CharacterDataArea dataArea = new CharacterDataArea(system, path.getPath()); // Create the character data area on the AS/400 using default values. dataArea.create(); // Clear the data area. dataArea.clear(); // Write to the data area. dataArea.write("Hello world"); // Read from the data area. String data = dataArea.read(); // Delete the data area from the AS/400. dataArea.delete();
Constructor Summary | |
CharacterDataArea()
Constructs a CharacterDataArea object. |
|
CharacterDataArea(AS400 system,
java.lang.String path)
Constructs a CharacterDataArea object. |
Method Summary | |
void |
clear()
Resets the data area to contain all blanks. |
void |
create()
Creates a character data area on the AS/400. |
void |
create(int length,
java.lang.String initialValue,
java.lang.String textDescription,
java.lang.String authority)
Creates a character data area with the specified attributes. |
void |
delete()
Removes the data area from the system. |
java.lang.String |
getPath()
Returns the integrated file system path name of the object represented by the data area. |
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 |
setPath(java.lang.String path)
Sets the fully qualified data area name. |
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 CharacterDataArea()
public CharacterDataArea(AS400 system, java.lang.String path)
system
- The AS/400 that contains the data area.path
- The fully qualified integrated file system path name. The
integrated file system file extension for a data area is DTAARA. An example of a
fully qualified integrated file system path to a data area "MYDATA" in library
"MYLIB" is: /QSYS.LIB/MYLIB.LIB/MYDATA.DTAARAMethod Detail |
public void clear() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
public void create() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
public void create(int length, java.lang.String initialValue, java.lang.String textDescription, java.lang.String authority) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
length
- The maximum number of characters in the data area.
Valid values are 1 through 2000.initialValue
- The initial value for the data area.textDescription
- The text description for the data area.
The maximum length is 50 characters.authority
- The public authority level for the data area. Valid
values are *ALL, *CHANGE, *EXCLUDE, *LIBCRTAUT, *USE, or the name
of an authorization list. The maximum length is 10 characters.public void delete() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException, java.net.UnknownHostException
public java.lang.String getPath()
public java.lang.String read() throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
public java.lang.String read(int type) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
type
- The Data Area bidi string type, as defined by the CDRA (Character
Data Representataion Architecture). See
BidiStringType for more information and valid values.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).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.public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
// Create a CharacterDataArea object. CharacterDataArea dataArea = new CharacterDataArea(); // Set its path to be the data area "MYDATA" in the library "MYLIB". dataArea.setPath("/QSYS.LIB/MYLIB.LIB/MYDATA.DTAARA");
path
- The fully qualified integrated file system path name of the data area.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.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.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |