user manual

Chapter 27: Using VisiConnect 319
Application Development Overview
while ( iter != null && iter.hasNext() )
{
// Get a record element and extract value ...
}
// Set up the requirements for the ResultSet returned by the execution of
// an Interaction. This step is optional. Default values are used if
// requirements are not explicitly set.
com.shme.shmeAdapter.InteractionSpecImpl rsIxSpec = new
com.shme.shmeAdapter.InteractionSpecImpl();
rsIxSpec.setFetchSize( 20 );
rsIxSpec,setResultSetType(
javax.resource.cci.ResultSet.TYPE_SCROLL_INSENSITIVE );
// Execute an Interaction that returns a ResultSet
javax.resource.cci.ResultSet rSet =
(javax.resource.cci.ResultSet)ix.execute( rsIxSpec, input );
// Iterate over the ResultSet. The example here positions the cursor on the
// first row and then iterates forward through the contents of the
ResultSet.
// Appropriate get methods are then used to retrieve column values.
rSet.beforeFirst();
while ( rSet != null && rSet.next() )
{ // get the column values for the current row using the appropriate
// get methods
}
// This illustrates reverse iteration through the ResultSet
rSet.afterLast();
while ( rSet.previous() )
{ // get the column values for the current row using the appropriate
// get methods
}
// Extend the Record interface to represent an EIS-specific custom Record.
// The interface CustomerRecord supports a simple accessor/mutator design
// pattern for its field values. A development tool would generate the
// implementation class of the CustomerRecord
public interface CustomerRecord extends javax.resource.cci.Record,
javax.resource.cci.Streamable
{
public void setName( String name );
public void setId( String custId );
public void setAddress( String address );
public String getName();
public String getId();
public String getAddress();
}