NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)
Reply Data
All C and COBOL data types in the reply are converted to Java Strings.
Decimal Points
If the DDL description of a field contains an implied decimal point, the data conversion method inserts an explicit decimal
point in the Java String. The decimal point is inserted as many bytes from the right as is indicated by the precision of the
DDL description.
Signs
If a DDL description contains an embedded sign (either leading or trailing), the data conversion method inserts a sign as the
leading (first) character of the Java String.
If a DDL description contains a separate sign, the conversion method inserts the sign as the leading character of the Java
String.
Conversion Exceptions
To allow for replies where the server does not supply values for all fields in the reply definition, all fields are converted
before any conversion exception is thrown.
If a conversion error occurs, the generated TsmpServerReply class sets the field in error to null. You can then invoke
the method TsmpReplyException.getUnconvertedFields(), which returns a list of fields for which conversion
errors occurred. Compare this list to a list of the errors you expected to determine if an unexpected conversion error has
occurred.
float and double Values
In the requester (the Java program that communicates with the Pathway server), each NSK float or double value is
represented as a Java String.
For a request, the Java String representation of the float or double value is converted to an actual NSK float or
double value prior to sending the request to the Pathway server.
For a reply, the actual NSK float or double value is converted to a Java String representing the NSK float or
double value after receiving a reply from the server.
Note: If you convert the Java String that represents a NSK float or double to a Java Float or Double,
you might lose precision or accuracy due to the incompatibilities between the NSK floating-point representation
and the IEEE floating-point required by Java. For more information, see IEEE Floating-Point Implementation.
Sample Pathway Program
The following sample program, employeeInfo, uses a Pathway server to add, read, and delete employee records in a
database. It would be started with a command line such as:
java employeeInfo -p \$PATHX -s PATHSVR
where $PATHX is the PATHMON process that monitors the Pathway server PATHSVR, with which the program
communicates.
(This program is included in NonStop
TM
Server for Java's demo directory under /usr/tandem/java/demo/tsmp.)