com.ibm.as400.micro
Class CommandCall

java.lang.Object
  extended bycom.ibm.as400.micro.CommandCall

public final class CommandCall
extends Object

The CommandCall class represents an iSeries command object. This class allows the user to call a CL command from a wireless device. This class provides a modified subset of the functions available in com.ibm.as400.access.CommandCall.

The following example demonstrates the use of CommandCall:

   // Work with commands.
   AS400 system = new AS400("mySystem", "myUserid", "myPwd", "myMEServer");
   try
   {
       // Run the command "CRTLIB FRED."
       String[] messages = CommandCall.run(system, "CRTLIB FRED");
       if (messages != null)
       {
           // Note that there was an error.
           System.out.println("Command failed:");
           for (int i = 0; i < messages.length; ++i)
           {
               System.out.println(messages[i]);
           }
       }
       else
       {
           System.out.println("Command succeeded!");
       }
   }
   catch (Exception e)
   {
       // Handle the exception
   }
   // Done with the system object.
   system.disconnect();
  

See Also:
CommandCall

Method Summary
static String[] run(AS400 system, String command)
          Runs the command on the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public static String[] run(AS400 system,
                           String command)
                    throws IOException,
                           MEException
Runs the command on the system.

Parameters:
command - The command to run on the system. If the command is not library qualified, the library list from the job description specified in the user profile will be used to find the command.
Returns:
the message text returned from running the command. An empty array will be return if there were no messages or if the command completed successfully.
Throws:
IOException - If an error occurs while communicating with the server.
MEException - If an error occurs while processing the ToolboxME request.