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

DDL Definitions for Requests and Replies
The DDL for the request and possible reply definitions are:
Definition EMPLOYEE-DEF.
02 EMPNUM Pic 9(4).
02 EMPNAME.
03 FIRST Pic X(20).
03 LAST Pic X(30).
03 MIDDLE Pic X.
02 REGNUM Pic 99.
02 BRANCHNUM Pic 99.
End
Definition EMPLOYEE-ADD.
02 REQUEST-CODE Pic 99.
02 EMPLOYEE-INFO Type EMPLOYEE-DEF.
End
Definition EMPLOYEE-REPLY.
02 REPLY-CODE Pic 99.
02 EMPLOYEE-INFO Type EMPLOYEE-DEF.
End
Definition ERROR-REPLY.
02 REPLY-CODE Pic 99.
02 ERROR-TEXT Pic X(60).
End
Item List File
The item list file, required as input to ddl2java, looks like this:
def employee-add,RQ,c,nn
def employee-request,RQ,c,nn
def employee-reply,RP,c,nn
def error-reply,RP,c,nn
Command Line for ddl2java
Here is a ddl2java command line to generate and compile Java class files based on the DDL definitions and item list file
shown in the preceding sections. As shown in the following source code, the package employee_class contains the
generated class files.
ddl2java -dpath /G/database/dict -i itemlist -p employee_class -c
Java Source Code
The Java source code for the employeeInfo() program is:
/*
* Demo client that communicates with legacy TSMP server
*/
// Generated classes from ddl2java