jsdai.lang
Interface QueryResultSet


public interface QueryResultSet

This interface defines the results of a query operation. That is the preferred way to obtain the results of a query.

See Also:
SdaiQuery

Nested Class Summary
static class QueryResultSet.ItemStruct
          This class is a structure to store query result item value in an efficient way.
 
Method Summary
 void close()
          Closes this result set.
 java.lang.Object getItem(int itemPos)
          Returns the item of the current result identified by the indexPos.
 QueryResultSet.ItemStruct getItemStruct(int itemPos, QueryResultSet.ItemStruct itemStruct)
          Returns the item of the current result identified by the indexPos to specified ItemStruct.
 boolean next()
          Moves to next result.
 

Method Detail

next

public boolean next()
             throws SdaiException
Moves to next result. In the beginning the result set is positioned before the first result therefore invoking this method sets the result set on the first result. If the position after last result set was reached it implicitly invokes close method.

Returns:
True if the next result is available and false if results are exhausted
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
See Also:
close()

getItem

public java.lang.Object getItem(int itemPos)
                         throws SdaiException
Returns the item of the current result identified by the indexPos.

Parameters:
itemPos - the index of the item. Items are numbered starting from 1.
Returns:
the item value. The object type is specific to a query.
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations

getItemStruct

public QueryResultSet.ItemStruct getItemStruct(int itemPos,
                                               QueryResultSet.ItemStruct itemStruct)
                                        throws SdaiException
Returns the item of the current result identified by the indexPos to specified ItemStruct.

Parameters:
itemPos - the index of the item. Items are numbered starting from 1.
itemStruct - the ItemStruct to put item value in
Returns:
a reference to itemStruct parameter
Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
Since:
3.6.0

close

public void close()
           throws SdaiException
Closes this result set. This releases all resources connected to the result set and puts it into invalid state. Any method called on the result set after it was closed other than close may give unpredictable result. This method does not have to be called if the last call to next method returned false because it closes the result set implicitly.

Throws:
SdaiException - if an error occurs during the operation or in underlying JSDAI operations
Since:
4.1.0
See Also:
next()

Copyright © LKSoftWare GmbH, 1999-2008