|
The SELECTION_JOB_QUEUE value is used only to select jobs that are currently on the job queue. If the job is active or on an outq, this selection criteria is not used to compare to what jobq the job came from originally. Try using job.getQueue().equals(jobq) to determine what jobq the job is on or that the job was on. HTH, Gary > -----Original Message----- > From: java400-l-bounces@xxxxxxxxxxxx > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of > tjuggler@xxxxxxxxxxxxxx > Sent: Tuesday, August 12, 2003 3:55 AM > To: java400-l@xxxxxxxxxxxx > Subject: Retriving jobs from AS/400 > > > Hello > I've been trying to retrive list of jobs from an as/400 machine. > Here is an examle. > public static void CheckJobQueue(String jobq) { if (as == > null) Connect(); JobList jobs = new JobList(as); try { > jobs.addJobSelectionCriteria(JobList.SELECTION_JOB_QUEUE,jobq) > ; } catch (Exception e) > {System.err.println(e.toString()); return ;} if > (jobs.getLength() == 0) return; try { for (Enumeration e > = jobs.getJobs(); e.hasMoreElements();) { Job job = (Job) > e.nextElement(); if (job.getStatus().compareTo("*ACTIVE") > == 0) System.out.println(job.toString()+ " " + > job.getStatus()); } jobs.close(); } catch (Exception > e) { return; } } > The most important thing is that I want only jobs from specifed jobq. > I use addJobSelectionCriteria JobList.SELECTION_JOB_QUEUE,jobq); > to select jobs from specified jobq. Unfortuantely the function returns > all jobs runninng on the machine. I've been trying also to add another > selection criteria and then exception occurs > java.lang.ArrayIndexOutOfBoundsException: 1 > Can anyone can me what I've been doing wrong ???? > BR > TJ > PS Java 1.4.2, Win2000, Eclipse 20030723, AS/400 V5R2 > JavaToolbox dated 2003-04-18 > _______________________________________________ > This is the Java Programming on and around the iSeries / > AS400 (JAVA400-L) mailing list > To post a message email: JAVA400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/java400-l > or email: JAVA400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.