Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AS400 - Running CommandCall in thread?

807597May 17 2005
I want to run CommandCall in a thread instead of firing it directly using CommandCall.run(). Is there any alternative to it. Here by is the code given below :-
                        AS400 system = new AS400("url","username","pwd","");			  
 			CommandCall FirstCmdCall = new CommandCall(system);
			/** Initializing the Command **/
			FirstCmdCall.setCommand("...Any Command...");						
			String runStatus ="";
			Job myJob = FirstCmdCall.getServerJob();
			String jobName = myJob.getName(); 
			String jobUser = myJob.getUser();
			String newJobNum = myJob.getNumber();
			
			 myJob = new Job(system, jobName, jobUser, newJobNum);
			 runStatus = (String)myJob.getValue(Job.ACTIVE_JOB_STATUS);
			 while (runStatus != null &&
			 		(runStatus.equals(Job.ACTIVE_JOB_STATUS_RUNNING)			 		                                     ||
			 		runStatus.equals(Job.ACTIVE_JOB_STATUS_WAIT_TIME_INTERVAL)			 		                                     ||
			 		runStatus.equals(Job.ACTIVE_JOB_STATUS_NONE)))			 		      
			 {			 		          
			 	try			 	
				{	
			 	 	RJob rjob = FirstCmdCall.getJob();  			 	     
			 		myJob.loadInformation(); 
			 		myJob = new Job(system, jobName, jobUser, newJobNum);
			 		myJob.loadInformation();
			 		runStatus = (String)myJob.getValue(Job.ACTIVE_JOB_STATUS);	 		
				}			 		 
			 	catch (AS400Exception exc)			 		          
				{
			 	
				}
			 	
			 }
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2005
Added on May 17 2005
0 comments
106 views