Using tuxedo buffer types with jolt, Using the string buffer type – HP NonStop G-Series User Manual
Page 71
// remove leading "$" before converting string to float
float w = Float.valueOf(wbal.substring(1)).floatValue();
if (w < 0.0)
{
System.err.println("Insufficient funds");
trans.rollback();
System.exit(1);
}
else // now attempt to deposit/transfer the funds
{
deposit.addInt("ACCOUNT_ID", 100001);
deposit.addString("SAMOUNT", "100.00");
deposit.call(trans);
String dbal = deposit.getStringDef("SBALANCE", "-1.0");
trans.commit();
System.out.println("Successful withdrawal");
System.out.println("New balance is: " + wbal);
System.out.println("Successful deposit");
System.out.println("New balance is: " + dbal);
}
session.endSession();
System.exit(0);
} // end main
} // end SimXfer
Using TUXEDO Buffer Types with Jolt
Jolt supports all of the TUXEDO typed buffers, data types, and buffer types including the built-in TUXEDO buffer types such as FML,
VIEW, CARRAY, and STRING. The following sections include examples for using the TUXEDO STRING, CARRAY, FML, and VIEW
buffer types.
For information about all of the TUXEDO typed buffers, data types, and buffer types, refer to the NonStop TUXEDO Application
Programming Guide and the NonStop TUXEDO Reference Manual.
Of the TUXEDO built-in buffer types, the Jolt application programmer should be particularly aware of how Jolt handles the CARRAY
(character array) and STRING built-in buffer types. The CARRAY type is used to handle data opaquely, (e.g., the characters of a
CARRAY data type are not interpreted in any way). No data conversion is performed between a Jolt client and TUXEDO service.
For example, if a TUXEDO service uses a CARRAY buffer type and the user sets a 32-bit integer (in Java the integer is in big-endian byte
order), then the data is sent unmodified to the TUXEDO service. If the TUXEDO service is run on a machine whose processor uses
little-endian byte-ordering (e.g., Intel processors), the TUXEDO service must convert the data properly before the data can be used.
Using the STRING Buffer Type
The STRING buffer type is a collection of characters. STRING consists of non-null characters and is terminated by a null character. The
STRING data type is character and, unlike CARRAY, you can determine its transmission length by counting the number of characters in
the buffer until reaching the null character.
Note
During the data conversion from Jolt to STRING, the null terminator is automatically
appended to the end of the STRING buffers because a Java string is not null-terminated.
TUXEDO simpapp example.
Define TOUPPER in the Repository Editor
Before running
, you need to define the TOUPPER service through the Jolt Repository Editor: