com.ibm.as400.access

Class CharacterDataArea

  • All Implemented Interfaces:
    Serializable


    public class CharacterDataArea
    extends DataArea
    implements Serializable
    The CharacterDataArea class represents a character data area on the system.

    The following example demonstrates the use of CharacterDataArea:

    // Prepare to work with the 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 system 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 system.
    dataArea.delete();
    

    Note: Most of the read() and write() methods of this class automatically convert characters between Unicode and the CCSID associated with the AS400 object. See AS400.getCcsid().

    See Also:
    Serialized Form