There are two ways to construct a basic terminal: using the default constructor and using the basic terminal constructor.
To create a terminal using the default constructor, first instantiate a terminal, and then use the appropriate setter methods to set the required properties. Use only the setters that apply to a basic terminal. These methods are:
All the set methods, with the exception of setGateway, are optional and have a default setting of null. After you have defined your terminal, install it on the CICS® server using the connect() method. Use only this version of the connect() method. The connect(installTimeout) and connect(Session, InstallTimeout) methods are allowed only for extended terminals. See Installing a terminal on CICS and Synchronization and sessions for further information.
try {
EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
Terminal term = new Terminal();
term.setGateway(eGate);
term.setServerName("CICS1");
term.connect();
}
catch (IOException ioEx) {
ioEx.printStackTrace();
}
catch (EPIException epiEx) {
epiEx.printStackTrace();
}
The second way is to use the basic terminal constructor. This sets all the required properties and automatically connects you to the CICS Server.
try {
EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
Terminal term = new Terminal(eGate, "CICS1", null, null);
}
catch (IOException ioEx) {
ioEx.printStackTrace();
}
catch (EPIException epiEx) {
epiEx.printStackTrace();
}