Progress
Open Client
Developer’s Guide


Miscellaneous Management Methods

These methods facilitate various management functions on an SDOResultSet, and include standard JDBC 2 methods and extensions to manage SmartDataObjects.

Standard JDBC 2 Management Methods

The supported standard JDBC 2 management methods include:

SYNTAX
void close() 

Closes the SDOResultSet and releases the underlying SmartDataObject. Any local modifications that have not been sent to the AppServer are lost when this method is called.

SYNTAX
SDOResultSetMetaData getMetaData() 

Returns the SDOResultSetMetaData object, which is an extension of the JDBC ResultSetMetaData object.

SYNTAX
void refreshRow() 

Gets the latest version of the current row from the database.

SYNTAX
boolean wasNull() 

Indicates if the last fetched value from a getDatatype() method equal to the 4GL unknown value (?).

This method is especially useful for methods that return a primitive data type, as in this example where SDOResults is an SDOResultSet:

int cValue;
cValue = SDOResults.getInt("QUANTITY");
if (SDOResults.wasNull())
   return(-1); 

Because a primitive data type cannot hold the null value (the Java object equivalent to the 4GL unknown value (?)), wasNull() provides the equivalent for the int value returned by getInt(). In this example, the method fragment returns the value –1 for a 4GL unknown value (?) because valid integer values for the QUANTITY column must be positive.

SYNTAX
int findColumn(String columnName) 

Returns the column index.

SYNTAX
int getFetchSize() 

Returns the size (in number of rows) of the buffer the underlying implementation uses to fetch rows from the AppServer.

SmartDataObject Management Methods [Extension]

The following nonstandard SDOResultSet methods support a variety of features unique to SmartDataObject management.

NOTE: The rowId value referenced in the following methods is equivalent to the value returned by the 4GL ROWID function and the SDOResultSet.getRowIdentity() method. For more information on ROWID, see the Progress Programming Handbook (or the Progress DataServer Guide for any DataServer accessed by the SmartDataObject).

SYNTAX
void reOpenQuery() [Extension] 

Reopens the SmartDataObject query and positions the cursor before the first row. This method refreshes all the data in the SDOResultSet, makes all of the newly inserted rows visible, and removes all of the deleted rows. Any local modifications that you have not sent to the AppServer before you call this method are lost.

SYNTAX
void reOpenQuery(String rowId) [Extension] 

Works like reOpenQuery(), but the first row returned is the one specified by rowId. A null rowId is equivalent to reOpenQuery(). It is usually more efficient to call reOpenQuery(String rowId) than to call reOpenQuery(), then call absolute(String rowId) in order to reposition on the specified row.

NOTE: If the SDOResultSet is in SDOScrollingMode.PREFETCH mode, you cannot get the rows before this rowId. For more information on SDOScrollingMode.PREFETCH, see the "Understanding SDOResultSet Scrolling Modes" section.

SYNTAX
String getRowIdentity() [Extension] 

Gets the string representation of the ROWID value for the current row that can be used as input to reOpenQuery(String rowId), absolute(String rowId), and SDOParameters.setRowIdentity(String rowId).

SYNTAX
String getQuery() [Extension] 

Returns the 4GL query that populated this SDOResultSet object.

SYNTAX
boolean absolute(String rowId) [Extension] 

Repositions the cursor at the row specified by rowId.

SYNTAX
SDOInterface getSDOInterface() [Extension] 

Provides direct access to the underlying 4GL methods of the SmartDataObject that are efficient for remote SmartDataObject access. The returned SDOInterface is a ProcObject that includes all of the relevant public methods provided by the SmartDataObject. Thus, you have full access to these SmartDataObject features without any limit imposed by the SDOResultSet interface. If the SDOResultSet is Stateless, calling getSDOInterface() creates a remote SmartDataObject procedure that you can delete only by calling releaseSDOInterface(). Calling releaseSDOInterface() on a nonStateless SDOResultSet has no effect. The actual SmartDataObject methods supported through SDOInterface include:

For more information on these SmartDataObject methods, see the Progress ADM 2 Guide and the Progress ADM 2 Reference .

NOTE: A typical application does not require access to the SDOInterface directly. Direct access to SmartDataObject methods requires expert knowledge of SmartDataObject internals. In some cases, mixing direct calls to the SmartDataObject with calls through the SDOResultSet interface can leave the SDOResultSet in an unexpected state. Thus, use the SDOInterface directly only after carefully analyzing the alternatives.

SYNTAX
void releaseSDOInterface() [Extension] 

On a Stateless SDOResultSet, releases the remote SmartDataObject procedure. Calling releaseSDOInterface() on an SDOResultSet that is not Stateless has no effect. This method is used in conjunction with getSDOInterface().


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095