com.ibm.as400.access

Class EnvironmentVariableList

  • All Implemented Interfaces:
    Serializable


    public class EnvironmentVariableList
    extends Object
    implements Serializable
    The EnvironmentVariableList class represents a list of IBM i system-level environment variables.

    This class can only access system-level environment variables. You must have *JOBCTL special authority to add, change, or delete system-level environment variables.

    This example gets the list of environment variables as a java.util.Properties object:

        AS400 system = new AS400("mysystem");
        EnvironmentVariableList evList = new EnvironmentVariableList(system);
        Properties p = evList.getProperties();
     

    This example uses an Enumeration to print the list of environment variable names and values:

        AS400 system = new AS400("mysystem");
        EnvironmentVariableList evList = new EnvironmentVariableList(system);
        Enumeration list = evList.getEnvironmentVariables();
        while (list.hasMoreElements())
        {
            EnvironmentVariable ev = (EnvironmentVariable)list.nextElement();
            System.out.println(ev.getName() + "=" + ev.getValue());
        }
     
    See Also:
    EnvironmentVariable, Serialized Form