12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

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.

Application development overview<br />

// Iterate over the ResultSet. The example here positions the cursor on the<br />

// first row and then iterates forward through the contents of the ResultSet.<br />

// Appropriate get methods are then used to retrieve column values.<br />

rSet.beforeFirst();<br />

while ( rSet != null && rSet.next() )<br />

{<br />

// get the column values for the current row using the appropriate<br />

// get methods<br />

}<br />

// This illustrates reverse iteration through the ResultSet<br />

rSet.afterLast();<br />

while ( rSet.previous() )<br />

{<br />

// get the column values for the current row using the appropriate<br />

// get methods<br />

}<br />

// Extend the Record interface to represent an EIS-specific custom Record.<br />

// The interface CustomerRecord supports a simple accessor/mutator design<br />

// pattern for its field values. A development tool would generate the<br />

// implementation class of the CustomerRecord<br />

public interface CustomerRecord extends javax.resource.cci.Record,<br />

javax.resource.cci.Streamable<br />

{<br />

public void setName( String name );<br />

public void setId( String custId );<br />

public void setAddress( String address );<br />

public String getName();<br />

public String getId();<br />

public String getAddress();<br />

}<br />

// Create an empty CustomerRecord instance to hold output from<br />

// the execution of an Interaction<br />

CustomerRecord customer = // ... create an instance<br />

// Create a PurchaseOrderRecord instance as an input to the Interaction<br />

// and set properties on this instance. The PurchaseOrderRecord is another<br />

// example of a custom Record<br />

PurchaseOrderRecord purchaseOrder = // ... create an instance<br />

purchaseOrder.setProductName( "..." );<br />

purchaseOrder.setQuantity( "..." );<br />

// ...<br />

// Execute an Interaction that populates the output CustomerRecord instance<br />

boolean crResponse = ix.execute( rsIxSpec, purchaseOrder, customer );<br />

// Check the CustomerRecord<br />

System.out.println( "Customer Name = [" + customer.getName() + "],<br />

Customer ID = [" + customer.getId() + "],<br />

Customer Address = [" + customer.getAddress() + "]" );<br />

274 BES Developer’s Guide

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

Saved successfully!

Ooh no, something went wrong!