NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)

try {
tx.rollback();
} catch (FSException er3) {}
System.exit(1);
}
} catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
}
return;
}
private static void getEmployeeInfo(String pmonName, String svrClassName) {
String getempNum[] = {0001,0002,0003,0004};
String empnum;
String firstName;
String lastName;
String middleInitial;
String regnum;
String branchnum;
String request_code = new String(01);
// Create a TsmpServer object supplying the PATHMON name and
// the serverclass name.
TsmpServer getserver = new TsmpServer(pmonName,svrClassName);
TsmpGenericServerReply greply = new TsmpGenericServerReply();
RQEmployee_request empRequest = new RQEmployee_request();
for(int i = 0; i < 4; i++) {
empRequest.setRequest_code(request_code);
empRequest.setEmployee_number(getempNum[i]);
// Send the request to the server.
try {
// Server is doing a read-only operation,
// so no transaction is required
getserver.service(empRequest, greply);
} catch (TsmpServerException e) {
System.out.println(e.getMessage());
System.exit(1);
}
try {
if(greply.getString(0, 2).equals(01)) {
RPEmployee_reply empReply = new RPEmployee_reply(greply);
System.out.println(First Name: + empReply.getFirst());
System.out.println(Middle Initial: + empReply.getMiddle());
System.out.println(Last Name: + empReply.getLast());
System.out.println(Region: + empReply.getRegnum());
System.out.println(Branch: + empReply.getBranchnum());
} else if(greply.getString(0, 2).equals(00)) {
RPError_reply errReply = new RPError_reply(greply);
System.out.println(errReply.getError_text());
System.exit(1);
} else {