public void test() throws ConnectionException {
log.info("TestSpecExampleTwo::test_specexampletwo");
long len = 0;
// TODO long event = 0; /* X_C_TYPE and subtype inq_buf. The structure
// */
Session cd; /* contains a character array named input and an */
/* array of integers named output. */
/* allocate typed buffer */
Buffer ptr = connection.tpalloc("X_C_TYPE", "inq_buf", 0);
/* populate typed buffer with input data */
((X_C_TYPE) ptr).setByteArray("input",
"retrieve all accounts with balances less than 0".getBytes());
// TODO tx_begin(); /* start global transaction */
/* connect to conversational service, send input data, & yield control */
cd = connection.tpconnect(RunServer.getServiceNameINQUIRY(), ptr,
Connection.TPRECVONLY | Connection.TPSIGRSTRT);
do {
try {
/* receive 10 account records at a time */
ptr = cd.tprecv(Connection.TPSIGRSTRT);
/*
* Format & display in AP-specific manner the accounts returned.
*/
} catch (ResponseException e) {
if (e.getTperrno() == Connection.TPEEVENT