01.01.2013 Views

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

if (managed)<br />

{<br />

getConnection();<br />

}<br />

else<br />

{<br />

getNonManagedConnection(<br />

username,<br />

password,<br />

gatewayURL,<br />

gatewayPort,<br />

cicsServer,<br />

mirror,<br />

trace);<br />

}<br />

370 <strong>CICS</strong> <strong>Transaction</strong> <strong>Gateway</strong> <strong>V5</strong><br />

Figure B-34 getting the connection factory<br />

After this, we enable <strong>CICS</strong> TG Java client trace if the appTrace parameter is true.<br />

<strong>The</strong> next section of code sets up the ECIInteractionSpec object eSpec, shown in<br />

Figure B-35. This encapsulates the <strong>CICS</strong> program name, COMMAREA length,<br />

and details of how to flow the request. We specify SYNC_SEND_RECEIVE for a<br />

synchronous request.<br />

// setup the interactionSpec.<br />

eSpec.setFunctionName(funcName);<br />

eSpec.setCommareaLength(commareaLength);<br />

// set reply length to same size as commarea<br />

eSpec.setReplyLength(commareaLength);<br />

eSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);<br />

Figure B-35 Setting the ECI interaction spec<br />

We then execute the <strong>CICS</strong> program a number of times, specified with the<br />

iterations parameter. <strong>The</strong> section of code for one execution is shown in<br />

Figure B-36 on page 371.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!