System properties

You can specify system properties to configure various aspects of the IBM 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 in that when you change a system property during runtime, the change is generally not reflected until the next time you run the application.

There are several ways that you can set system properties:

If an IBM 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

IBM Toolbox for Java supports the following system properties:

Proxy server properties

Proxy server property Description
com.ibm.as400.access.AS400.proxyServer Specifies the proxy server host name and port number, using the format:
   hostName:portNumber
The port number is optional.
com.ibm.as400.access.SecureAS400.proxyEncryptionMode

Specifies which portion of the proxy data flow is encrypted by using SSL. Valid values are:

  • 1 = Proxy client to proxy server
  • 2 = Proxy server to IBM i system
  • 3 = Proxy client to proxy server and proxy server to IBM i system
com.ibm.as400.access.TunnelProxyServer.clientCleanupInterval Specifies how often, in seconds, the proxy server looks for idle connections. The proxy server starts a thread to look for clients that are no longer communicating. Use this property to set how often the thread looks for idle connections.
com.ibm.as400.access.TunnelProxyServer.clientLifetime Specifies how long, in seconds, a client can be idle before the proxy server removes references to the objects so the JVM can garbage collect them. The proxy server starts a thread to look for clients that are no longer communicating. Use this property to set how long a client can be idle before performing garbage collection on it.

Trace properties

Trace property Description
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.
com.ibm.as400.access.ServerTrace.JDBC Specifies which trace categories to start on the JDBC server job. For information about supported values, see the JDBC server trace property.

CommandCall/ProgramCall properties

CommandCall/ProgramCall property Description
com.ibm.as400.access.CommandCall.threadSafe Specifies whether CommandCalls should be assumed to be thread-safe. If true, all CommandCalls are assumed to be thread-safe. If false, all CommandCalls are assumed to be non-thread-safe. This property is ignored for a given CommandCall object if either CommandCall.setThreadSafe(true/false) or AS400.setMustUseSockets(true) has been performed on the object.
com.ibm.as400.access.ProgramCall.threadSafe Specifies whether ProgramCalls should be assumed to be thread-safe. If true, all ProgramCalls are assumed to be thread-safe. If false, all ProgramCalls are assumed to be non-thread-safe. This property is ignored for a given ProgramCall object if either ProgramCall.setThreadSafe(true/false) or AS400.setMustUseSockets(true) has been performed on the object.