Consultor Eletrônico



Kbase 19380: OPEN CLIENT: SDOResultSet & SDOParameters Object Interaction
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/01/2000
When creating an instance of SDOResultSet it is possible to modify some default behavior by passing an instance of the SDOParameters class as the fourth (4th) parameter to the _createSDOResultSet method of the SDOAppObject class.

It is important to understand that the set* methods in the SDOParameters class must be invoked (if needed) before passing the object to the _createSDOResultSet method. Invoking the set* methods *after* creating the SDOResultSet has no effect upon the SDOResultSet.

The following code shows how this code might look in a real application:

public static void main(String[] args)
{
SDOParameters params = new SDOParameters();
SDOAppObject asv = null;
SDOResultSet data = null;

try
{
// Configure SDO Parameters for a Stateless
//AppServer Environment
params.setStateless(true);
params.setFetchSize(50);
params.setPrefetchMaxRows(5);
params.setRowIdentity(someRowIdString);

// Connect to AppServer and Instantiate SmartDataObject
asv = new SDOAppObject("AppServer://zzz:5162/y",null,null,null);

data = asv._createSDOResultSet("dCustomer.w", null, null, params);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
// Close ResultSet and Disconnect from AppServer
try
{
data.close();
asv._release();
}
catch (Exception e)
{
}
finally
{
System.exit(0);
}
}
}