com.stc.eindex.ejb.query
Class QueryResults

java.lang.Object
  extended bycom.stc.eindex.ejb.query.QueryResults
All Implemented Interfaces:
java.io.Serializable

public class QueryResults
extends java.lang.Object
implements java.io.Serializable

The QueryResults class is used for tuple creation and for late assembling of tuples. This is returned from QueryManager.execute() when QueryObject.setAssembleDescriptor is set to null. QueryResults wraps the java.sql.ResultSet class.

See Also:
Serialized Form

Constructor Summary
(package private) QueryResults(java.sql.Connection con, java.sql.ResultSet[] resultSets, java.sql.Statement[] statements, SQLDescriptor[] sqlDesc, int queryOption)
          Creates a new instance of the QueryResults class.
 
Method Summary
 QMIterator assemble()
          Initiates the tuple assembly process.
 void close()
          Closes the instance of the QueryResults class.
 void setAssembleDescriptor(AssembleDescriptor assDesc)
          Sets the assemble descriptor (AssembleDescriptor class) for the given query results object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResults

QueryResults(java.sql.Connection con,
             java.sql.ResultSet[] resultSets,
             java.sql.Statement[] statements,
             SQLDescriptor[] sqlDesc,
             int queryOption)
Creates a new instance of the QueryResults class.

Parameters:
con - A connection to the database.
resultSets - An array of query results.
statements - An array of SQL statements.
sqlDesc - An array of SQL descriptors.
queryOption - An indicator of the query type. 1 indicates SINGLE_QUERY; 2 indicates MULTIPLE_QUERY. The default is SINGLE_QUERY.
Throws:
None.
Method Detail

assemble

public QMIterator assemble()
                    throws QMException
Initiates the tuple assembly process. After performing an internal initialization, this method returns a QMIterator object, from which the tuples can then be retrieved.

Parameters:
None.

Returns:
QMIterator - An iterator of assembled tuples for the query results object.
Throws:
QMException - Thrown if an error occurs while assembling the tuple.

close

public void close()
           throws QMException
Closes the instance of the QueryResults class.

Parameters:
None.
Returns:
void - None.

Throws:
QMException - Thrown if an error occurs while closing the instance.

setAssembleDescriptor

public void setAssembleDescriptor(AssembleDescriptor assDesc)
Sets the assemble descriptor (AssembleDescriptor class) for the given query results object. The assemble descriptor contains information such as the query results composite object, iterator type, and the assembler to use.

Parameters:
assDesc - The assemble descriptor to use for this query object.
Returns:
void - None.
Throws:
None.


Copyright 2007 by Sun Microsystems, Inc. All Rights Reserved.