System properties

System properties can be specified to configure various aspects of the AS/400 Toolbox for Java. For example, you can use system properties to define a proxy server or a level of tracing. System properties are useful for convenient runtime configuration without needing to recompile code. System properties work like environment variables. If a system property is changed during runtime, the change will generally not be reflected until the next time the application is run.

There are several ways to set system properties:

If an AS/400 Toolbox for Java system property is set using more than one of the mechanisms described above, then the precedence is as follows (in order of decreasing precedence):

  1. The system property set programmatically using java.lang.System.setProperties()
  2. The system property set using the -D option of the java command
  3. The system property set using a Properties class
  4. The system property set using a jt400.properties file

The following system properties are supported by the AS/400 Toolbox for Java:

Property name Description
Proxy server properties
"com.ibm.as400.access.AS400.proxyServer" Specifies the proxy server host name and port number, specified in the format:
    hostName:portNumber
The port number is optional.
Trace properties
"com.ibm.as400.access.Trace.category" Specifies which trace categories to enable. This is a comma-delimited list containing any combination of trace categories. The complete list of trace categories is defined in the Trace class.
"com.ibm.as400.access.Trace.file" Specifies the file to which trace output is written. The default is to write trace output to System.out.