com.ibm.as400.micro
Class CommandCall
java.lang.Object
|
+--com.ibm.as400.micro.CommandCall
- public final class CommandCall
- extends java.lang.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 java.lang.String[] |
run(AS400 system,
java.lang.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 |
run
public static java.lang.String[] run(AS400 system,
java.lang.String command)
throws java.io.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:
java.io.IOException
- If an error occurs while communicating with the server.MEException
- If an error occurs while processing the ToolboxME request.