106 lines
5.2 KiB
HTML
106 lines
5.2 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="Jobs classes" />
|
|
<meta name="abstract" content="" />
|
|
<meta name="description" content="" />
|
|
<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="jobs" />
|
|
<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>Jobs classes</title>
|
|
</head>
|
|
<body id="jobs"><a name="jobs"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Jobs classes</h1>
|
|
<div><p></p>
|
|
<div class="section"><p>The IBM<sup>®</sup> Toolbox
|
|
for Java™ Jobs
|
|
classes (in the access package) allow a Java program to retrieve and change job
|
|
information. </p>
|
|
<div class="note"><span class="notetitle">Note:</span> Toolbox for Java also provides <a href="resources.htm#resources">resource
|
|
classes</a> that present a generic framework and consistent programming
|
|
interface for working with various iSeries™ objects and lists. After reading
|
|
about the classes in the <a href="javadoc/com/ibm/as400/access/package-summary.html#NAVBAR_TOP">access package</a> and the <a href="javadoc/com/ibm/as400/resource/package-summary.html#NAVBAR_TOP">resource package</a>, you can choose the object that works
|
|
best for your application. The resource classes for working with jobs are <a href="javadoc/com/ibm/as400/resource/RJob.html#NAVBAR_TOP"> RJob</a>, <a href="javadoc/com/ibm/as400/resource/RJobList.html#NAVBAR_TOP"> RJobList</a>, and <a href="javadoc/com/ibm/as400/resource/RJobLog.html#NAVBAR_TOP"> RJobLog</a>.</div>
|
|
<p>Use the Jobs classes to work with
|
|
the following type of job information:</p>
|
|
<ul><li>Date and Time Information</li>
|
|
<li>Job Queue</li>
|
|
<li>Language Identifiers</li>
|
|
<li>Message Logging</li>
|
|
<li>Output Queue</li>
|
|
<li>Printer Information</li>
|
|
</ul>
|
|
<p>The job classes in the access package are as follows:</p>
|
|
<ul><li><a href="job.htm#job">Job</a> - retrieves and changes iSeries job
|
|
information</li>
|
|
<li><a href="joblist.htm#joblist">JobList</a> - retrieves a list of iSeries jobs</li>
|
|
<li><a href="joblog.htm#joblog">JobLog</a> - represents the job log
|
|
of an iSeries</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" id="jobs__cutjob"><a name="jobs__cutjob"><!-- --></a><h4 class="sectiontitle">Examples</h4><div class="p">The following examples show
|
|
some of the ways you can use the Job, JobList, and JobLog classes. The first
|
|
example shows one way to use a cache with the Job class. Links to other examples
|
|
immediately follow the sample code. <div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm#codedisclaimer">Code
|
|
example disclaimer</a> for important legal information.</div>
|
|
</div>
|
|
<p><strong>Example:
|
|
Using a cache when setting a value and getting a value</strong></p>
|
|
<pre> try {
|
|
|
|
// Creates AS400 object.
|
|
AS400 as400 = new AS400("systemName");
|
|
|
|
// Constructs a Job object
|
|
Job job = new Job(as400,"QDEV002");
|
|
|
|
// Gets job information
|
|
System.out.println("User of this job :" + job.getUser());
|
|
System.out.println("CPU used :" + job.getCPUUsed();
|
|
System.out.println("Job enter system date : " + job.getJobEnterSystemDate());
|
|
|
|
// Sets cache mode
|
|
job.setCacheChanges(true);
|
|
|
|
// Changes will be store in the cache.
|
|
job.setRunPriority(66);
|
|
job.setDateFormat("*YMD");
|
|
|
|
// Commit changes. This will change the value on the iSeries.
|
|
job.commitChanges();
|
|
|
|
// Set job information to system directly(without cache).
|
|
job.setCacheChanges(false);
|
|
job.setRunPriority(60);
|
|
} catch (Exception e)
|
|
{
|
|
System.out.println(quot;error :" + e)
|
|
}</pre>
|
|
<p>The following examples show how to list the jobs belonging
|
|
to a specific user, list jobs with the job status information, and display
|
|
the messages in a job log:</p>
|
|
<blockquote><p><a href="listjobs2.htm#listjobs2">Example: Using JobList to list job identification information</a></p>
|
|
<p><a href="listjobs.htm#listjobs">Example: Using JobList to get a list of jobs</a></p>
|
|
<p><a href="joblogexample.htm#joblogexample">Example: Using JobLog to display messages in the job log</a></p>
|
|
</blockquote>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |