252 lines
14 KiB
HTML
252 lines
14 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="System properties" />
|
||
|
<meta name="abstract" content="You can specify system properties to configure various aspects of the IBM Toolbox for Java." />
|
||
|
<meta name="description" content="You can specify system properties to configure various aspects of the IBM Toolbox for Java." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahnm03.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="systempropertiessample1.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="systempropertiessample2.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="systemproperties" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>System properties</title>
|
||
|
</head>
|
||
|
<body id="systemproperties"><a name="systemproperties"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">System properties</h1>
|
||
|
<div><p>You can specify system properties to configure various aspects
|
||
|
of the IBM<sup>®</sup>
|
||
|
Toolbox for Java™.</p>
|
||
|
<div class="section"><p>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.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>There are several ways that you can set system properties:</p>
|
||
|
</div>
|
||
|
<div class="section"><ul><li><strong>Using the java.lang.System.setProperties() method</strong> <p>You can set
|
||
|
system properties programmatically by using the java.lang.System.setProperties()
|
||
|
method.</p>
|
||
|
<p>For example, the following code sets the <tt>com.ibm.as400.access.AS400.proxyServer</tt> property
|
||
|
to <tt>hqoffice</tt>:</p>
|
||
|
<div class="p"><pre>Properties systemProperties = System.getProperties();
|
||
|
systemProperties.put ("com.ibm.as400.access.AS400.proxyServer", "hqoffice");
|
||
|
System.setProperties (systemProperties);</pre>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li><strong>Using the <span>-D</span> option of the <span>java</span> command</strong> <p>Many
|
||
|
environments allow you to set system properties when running applications
|
||
|
from a command line by using the <tt>-D</tt> option of the <tt>java</tt> command.</p>
|
||
|
<p>For
|
||
|
example, the following program runs the application called Inventory with
|
||
|
the <tt>com.ibm.as400.access.AS400.proxyServer</tt> property set to <tt>hqoffice</tt>:</p>
|
||
|
<div class="p"><pre> java -Dcom.ibm.as400.access.AS400.proxyServer=hqoffice Inventory</pre>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li><strong>Using a jt400.properties file</strong> <p>In some environments, it may be
|
||
|
inconvenient to instruct all users to set their own system properties. As
|
||
|
an alternative, you can specify IBM Toolbox for Java system properties in a file called
|
||
|
jt400.properties that is searched for as if it is part of the com.ibm.as400.access
|
||
|
package. In other words, place the jt400.properties file in a com/ibm/as400/access
|
||
|
directory pointed to by the classpath.</p>
|
||
|
<p>For example, set the <tt>com.ibm.as400.access.AS400.proxyServer</tt> property
|
||
|
to <tt>hqoffice</tt> by inserting the following line into the jt400.properties
|
||
|
file:</p>
|
||
|
<div class="p"><pre> com.ibm.as400.access.AS400.proxyServer=hqoffice</pre>
|
||
|
</div>
|
||
|
<p>The
|
||
|
backslash character (\) functions as an escape character in properties files.
|
||
|
Specify a literal backslash character by using two backslashes (\\).</p>
|
||
|
<p>Modify
|
||
|
this <a href="systempropertiessample1.htm#systempropertiessample1">sample</a> of
|
||
|
a jt400.properties file for your environment.</p>
|
||
|
</li>
|
||
|
<li><strong>Using a Properties class</strong> <p>Some browsers do not load properties
|
||
|
files without explicitly changing security settings. However, most browsers
|
||
|
do allow properties in .class files, so IBM Toolbox for Java system properties can also be specified
|
||
|
by a class called com.ibm.as400.access.Properties which extends java.util.Properties.</p>
|
||
|
<p>For
|
||
|
example, to set the <tt>com.ibm.as400.access.AS400.proxyServer</tt> property
|
||
|
to <tt>hqoffice</tt>, use the following Java code:</p>
|
||
|
<div class="p"><pre> package com.ibm.as400.access;
|
||
|
|
||
|
public class Properties
|
||
|
extends java.util.Properties
|
||
|
{
|
||
|
public Properties ()
|
||
|
{
|
||
|
put ("com.ibm.as400.access.AS400.proxyServer", "hqoffice");
|
||
|
}
|
||
|
}</pre>
|
||
|
</div>
|
||
|
<p>Modify and compile this <a href="systempropertiessample2.htm#systempropertiessample2">sample</a> of
|
||
|
a Properties.java source file for your environment.</p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><p>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):</p>
|
||
|
</div>
|
||
|
<div class="section"><ol><li>The system property set programmatically using <tt>java.lang.System.setProperties()</tt></li>
|
||
|
<li>The system property set using the <tt>-D</tt> option of the <tt>java</tt> command</li>
|
||
|
<li>The system property set using a Properties class</li>
|
||
|
<li>The system property set using a jt400.properties file</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
<div class="section"><div class="p">IBM Toolbox
|
||
|
for Java supports
|
||
|
the following system properties:<ul><li><a href="#systemproperties__proxy">Proxy server properties</a></li>
|
||
|
<li><a href="#systemproperties__traceprops">Trace properties</a></li>
|
||
|
<li><a href="#systemproperties__command">CommandCall/ProgramCall properties</a></li>
|
||
|
<li><a href="#systemproperties__ftpprops">FTP properties</a></li>
|
||
|
<li><a href="#systemproperties__connectionprops">Connection properties</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section" id="systemproperties__proxy"><a name="systemproperties__proxy"><!-- --></a><h4 class="sectiontitle">Proxy server properties</h4>
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr class="tablemainheaderbar"><th valign="top" width="60.71428571428571%" id="d0e204">Proxy server property</th>
|
||
|
<th valign="top" width="39.285714285714285%" id="d0e206">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="60.71428571428571%" headers="d0e204 ">com.ibm.as400.access.AS400.proxyServer</td>
|
||
|
<td valign="top" width="39.285714285714285%" headers="d0e206 ">Specifies the proxy server host name and port number, using the format: <div class="p"><pre> hostName:portNumber</pre>
|
||
|
The
|
||
|
port number is optional.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="60.71428571428571%" headers="d0e204 "> com.ibm.as400.access.SecureAS400.proxyEncryptionMode </td>
|
||
|
<td valign="top" width="39.285714285714285%" headers="d0e206 "><p>Specifies which portion of the proxy data flow is encrypted by using
|
||
|
SSL. Valid values are:</p>
|
||
|
<ul><li> 1 = Proxy client to proxy server</li>
|
||
|
<li> 2 = Proxy server to iSeries™</li>
|
||
|
<li> 3 = Proxy client to proxy server and proxy server to iSeries </li>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="60.71428571428571%" headers="d0e204 "> com.ibm.as400.access.TunnelProxyServer.clientCleanupInterval </td>
|
||
|
<td valign="top" width="39.285714285714285%" headers="d0e206 ">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.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="60.71428571428571%" headers="d0e204 "> com.ibm.as400.access.TunnelProxyServer.clientLifetime </td>
|
||
|
<td valign="top" width="39.285714285714285%" headers="d0e206 "> 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.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section" id="systemproperties__traceprops"><a name="systemproperties__traceprops"><!-- --></a><h4 class="sectiontitle">Trace properties</h4>
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="50%" id="d0e256">Trace property</th>
|
||
|
<th valign="top" width="50%" id="d0e258">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="50%" headers="d0e256 ">com.ibm.as400.access.Trace.category</td>
|
||
|
<td valign="top" width="50%" headers="d0e258 ">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 <a href="javadoc/com/ibm/as400/access/Trace.html#NAVBAR_TOP"> Trace</a> class.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="50%" headers="d0e256 ">com.ibm.as400.access.Trace.file</td>
|
||
|
<td valign="top" width="50%" headers="d0e258 ">Specifies the file to which trace output is written. The default is
|
||
|
to write trace output to System.out.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="50%" headers="d0e256 ">com.ibm.as400.access.ServerTrace.JDBC</td>
|
||
|
<td valign="top" width="50%" headers="d0e258 ">Specifies which trace categories to start on the JDBC server job.
|
||
|
For information about supported values, see the <a href="jdbcproperties.htm#jdbcproperties__other">JDBC
|
||
|
server trace property</a>.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section" id="systemproperties__command"><a name="systemproperties__command"><!-- --></a><h4 class="sectiontitle">CommandCall/ProgramCall properties</h4>
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="50%" id="d0e291">CommandCall/ProgramCall property</th>
|
||
|
<th valign="top" width="50%" id="d0e293">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="50%" headers="d0e291 ">com.ibm.as400.access.CommandCall.threadSafe</td>
|
||
|
<td valign="top" width="50%" headers="d0e293 ">Specifies whether CommandCalls might be assumed to be thread-safe.
|
||
|
If <tt>true</tt>, all CommandCalls are assumed to be thread-safe. If <tt>false</tt>,
|
||
|
all CommandCalls are assumed to be non-thread-safe. This property is ignored
|
||
|
for a given CommandCall object if either <tt>CommandCall.setThreadSafe(true/false)</tt> or <tt>AS400.setMustUseSockets(true)</tt> has
|
||
|
been performed on the object.</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="50%" headers="d0e291 ">com.ibm.as400.access.ProgramCall.threadSafe</td>
|
||
|
<td valign="top" width="50%" headers="d0e293 ">Specifies whether ProgramCalls might be assumed to be thread-safe.
|
||
|
If <tt>true</tt>, all ProgramCalls are assumed to be thread-safe. If <tt>false</tt>,
|
||
|
all ProgramCalls are assumed to be non-thread-safe. This property is ignored
|
||
|
for a given ProgramCall object if either <tt>ProgramCall.setThreadSafe(true/false)</tt> or <tt>AS400.setMustUseSockets(true)</tt> has
|
||
|
been performed on the object.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section" id="systemproperties__ftpprops"><a name="systemproperties__ftpprops"><!-- --></a><h4 class="sectiontitle">FTP properties</h4>
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr valign="bottom"><th valign="bottom" id="d0e339">FTP property </th>
|
||
|
<th valign="bottom" id="d0e341">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e339 ">com.ibm.as400.access.FTP.reuseSocket</td>
|
||
|
<td valign="top" headers="d0e341 ">Specifies whether the socket is reused for multiple
|
||
|
file transfers (through a single FTP instance), when in "active" mode. If <tt>true</tt>,
|
||
|
the socket is reused. If <tt>false</tt>, a new socket is created for each
|
||
|
file transfer. This property is ignored for a given FTP object if <tt>FTP.setReuseSocket(true/false)</tt> has
|
||
|
been performed on the object. </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section" id="systemproperties__connectionprops"><a name="systemproperties__connectionprops"><!-- --></a><h4 class="sectiontitle">Connection properties</h4>
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr valign="bottom"><th valign="bottom" id="d0e367">Connection property</th>
|
||
|
<th valign="bottom" id="d0e369">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e367 ">com.ibm.as400.access.AS400.signonHandler</td>
|
||
|
<td valign="top" headers="d0e369 ">Specifies the default signon handler. This property
|
||
|
is ignored for a given AS400 object if <tt>AS400.setSignonHandler()</tt> has
|
||
|
been performed on the object, or if <tt>AS400.setDefaultSignonHandler()</tt> has
|
||
|
been called.</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="systempropertiessample1.htm">Example: Properties File</a></strong><br />
|
||
|
</li>
|
||
|
<li class="ulchildlink"><strong><a href="systempropertiessample2.htm">Example: System Properties Class Source File</a></strong><br />
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahnm03.htm" title="Using IBM Toolbox for Java makes it easier to write client Java applets, servlets, and applications that access iSeries resources, data, and programs.">Install and manage IBM Toolbox for Java</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|