162 lines
8.6 KiB
HTML
162 lines
8.6 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="i5/OS optimization" />
|
|
<meta name="abstract" content="The IBM Toolbox for Java licensed program is written in Java, so it runs on any platform with a certified Java virtual machine (JVM). The IBM Toolbox for Java classes function in the same way no matter where they run." />
|
|
<meta name="description" content="The IBM Toolbox for Java licensed program is written in Java, so it runs on any platform with a certified Java virtual machine (JVM). The IBM Toolbox for Java classes function in the same way no matter where they run." />
|
|
<meta name="DC.Relation" scheme="URI" content="progtips.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="opt" />
|
|
<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>i5/OS optimization</title>
|
|
</head>
|
|
<body id="opt"><a name="opt"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">i5/OS optimization</h1>
|
|
<div><p>The IBM<sup>®</sup> Toolbox
|
|
for Java™ licensed
|
|
program is written in Java, so it runs on any platform with a
|
|
certified Java virtual machine (JVM). The IBM Toolbox for Java classes function in the same way no
|
|
matter where they run.</p>
|
|
<div class="section"><p>Additional classes come with i5/OS™ that enhance the behavior of the IBM Toolbox
|
|
for Java when
|
|
it is running on the iSeries™ JVM. Sign-on behavior and performance are
|
|
improved when running on the iSeries JVM and connecting to the same iSeries server.
|
|
i5/OS incorporated
|
|
the additional classes starting at Version 4 Release 3.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Enabling the optimizations</h4><p>IBM Toolbox for Java comes in two packages: as a separate
|
|
licensed program and with i5/OS.</p>
|
|
<ul><li>Licensed Program 5722-JC1. The licensed program version of IBM Toolbox for
|
|
Java ships
|
|
files in the following directory:<pre> /QIBM/ProdData/http/public/jt400/lib</pre>
|
|
<p> These
|
|
files do not contain i5/OS optimizations. Use these files if you want behavior
|
|
consistent with running the IBM Toolbox for Java on a client.</p>
|
|
</li>
|
|
<li>i5/OS. IBM Toolbox
|
|
for Java is
|
|
also shipped with i5/OS in directory<pre> /QIBM/ProdData/OS400/jt400/lib</pre>
|
|
<p> These
|
|
files do contain the classes that optimize the IBM Toolbox for Java when running on the iSeries JVM.</p>
|
|
<p>For
|
|
more information see <a href="jarfilelist.htm#jarfilelist__jt400classic">Note
|
|
1</a> in the information about <a href="jarfilelist.htm#jarfilelist">Jar
|
|
files</a>.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Sign-on considerations</h4><p>With the additional classes
|
|
provided with i5/OS, Java programs
|
|
have additional options for providing server (system) name, user ID and password
|
|
information to the IBM Toolbox for Java.</p>
|
|
<p>When accessing a resource on
|
|
an iSeries server,
|
|
the IBM Toolbox
|
|
for Java classes
|
|
must have a system name, user ID and password.</p>
|
|
<ul><li><strong>When running on a client</strong>, the system name, user ID and password
|
|
are provided by the Java program, or the IBM Toolbox for Java retrieves these values from the user
|
|
through a sign-on dialog.</li>
|
|
<li><strong>When running on the iSeries Java virtual machine</strong>, the IBM Toolbox for Java has
|
|
one more option. It can send requests to the current (local) server using
|
|
the user ID and password of the job that started the Java program.</li>
|
|
</ul>
|
|
<p>With the additional classes, the user ID and password of the current
|
|
job also can be used when a Java program that is running on one iSeries server
|
|
accesses the resources on another iSeries server. In this case, the Java program
|
|
sets the system name, then uses the special value "*current" for the user
|
|
ID and password.</p>
|
|
<p>The Java program can only set the password to
|
|
"*current" if you are using record-level access V4R4 or later. Otherwise,
|
|
when you use record-level access, "localhost" is valid for system name and
|
|
"*current" is valid for user ID; however, the Java program must supply the password.</p>
|
|
<p>A Java program
|
|
sets system name, user ID, and password values in the <a href="javadoc/com/ibm/as400/access/AS400.html#NAVBAR_TOP"> AS400</a> object.</p>
|
|
<p>To use the user ID and password
|
|
of the job, the Java program can use "*current" as user ID and password,
|
|
or it can use the constructor that does not have user ID and password parameters.</p>
|
|
<p>To
|
|
use the current server, the Java program can use "localhost" as the
|
|
system name or use the default constructor. That is,</p>
|
|
<pre> AS400 system = new AS400();</pre>
|
|
<p> is
|
|
the same as </p>
|
|
<pre> AS400 system = new AS400("localhost", "*current", "*current");</pre>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Examples</h4><p>The following examples show how to sign
|
|
on to a server by using optimized classes.</p>
|
|
<p id="opt__optex1"><a name="opt__optex1"><!-- --></a><strong>Example: Signing
|
|
on when using different AS400 constructors</strong></p>
|
|
<p>Two AS400 objects are
|
|
created in the following example. The two objects have the same behavior:
|
|
they both run a command to the current server using the user ID and password
|
|
of the job. One object uses the special value for the user ID and password,
|
|
while the other uses the default constructor and does not set user ID or
|
|
password.</p>
|
|
<pre> // Create an AS400 object. Since the default
|
|
// constructor is used and system, user ID and
|
|
// password are never set, the AS400 object sends
|
|
// requests to the local iSeries using the job's
|
|
// user ID and password. If this program were run
|
|
// on a client, the user would be prompted for
|
|
// system, user ID and password.
|
|
AS400 sys1 = new AS400();
|
|
|
|
// Create an AS400 object. This object sends
|
|
// requests to the local iSeries using the job's
|
|
// user ID and password. This object will not work
|
|
// on a client.
|
|
AS400 sys2 = new AS400("localhost", "*current", "*current");
|
|
|
|
// Create two command call objects that use the
|
|
// AS400 objects.
|
|
CommandCall cmd1 = new CommandCall(sys1,"myCommand1");
|
|
CommandCall cmd2 = new CommandCall(sys2,"myCommand2");
|
|
|
|
// Run the commands.
|
|
cmd1.run();
|
|
cmd2.run();</pre>
|
|
<p id="opt__optex2"><a name="opt__optex2"><!-- --></a><strong>Example: Signing on by using
|
|
the user ID and password of the current job</strong></p>
|
|
<p>In the following example
|
|
an AS400 object is created that represents a second iSeries server. Since "*current" is used,
|
|
the job's user ID and password from the iSeries server running the Java program
|
|
are used on the second (target) server.</p>
|
|
<pre> // Create an AS400 object. This object sends
|
|
// requests to a second iSeries using the user ID
|
|
// and password from the job on the current server.
|
|
AS400 sys = new AS400("mySystem.myCompany.com", "*current", "*current");
|
|
|
|
|
|
// Create a command call object to run a command
|
|
// on the target server.
|
|
CommandCall cmd = new CommandCall(sys,"myCommand1");
|
|
|
|
|
|
// Run the command.
|
|
cmd.run();</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="progtips.htm" title="This section features a variety of tips that can help you use IBM Toolbox for Java.">Tips for programming</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |