com.sas.iquery.execution2
Interface ResultSetInterface


public interface ResultSetInterface

The ResultSetInterface provides for a common abstraction of relational two dimensional result sets and N-dimensional OLAP result sets.

Additional metadata is also available that is not provided by the underlying result set. This includes the freshness of the result set getResultSetDate(), the SAS log generated by the query execution getSASLog(), the computational locale of the query execution getComputationalLocale(), and other IQ result set metadata.

A ResultSetInterface object is usually created by executing a DataSelection using a QueryConnector.


Field Summary
static java.lang.String MULTI_DIMENSIONAL
          Returned by SimpleQueryConnector.getResultSetStructure(BusinessQuery) for multi-dimensional result sets (OLAP or ROLAP)
static int MULTI_DIMENSIONAL_EMBEDDED
          Returned by getType()for embedded (in-memory, non-server-connected) multi-dimensional result set
static int MULTI_DIMENSIONAL_LIVE
          Returned by getType() for live (interactive and server connected) multi-dimensional result sets
static java.lang.String TABULAR
          Returned by SimpleQueryConnector.getResultSetStructure(BusinessQuery) for tabular result sets (relational data)
static int TABULAR_EMBEDDED
          Returned by getType()for embedded (in-memory, non-server-connected) tabular result sets
static int TABULAR_LIVE
          Returned by getType()for live (interactive and server connected) tabular result sets
 
Method Summary
 void close()
          Close the result set.
 java.util.Locale getComputationalLocale()
          Returns the Locale that the query computations were run under (or null if indeterminate).
 com.sas.util.LocalizableString getDescriptions(java.lang.String rsid)
          Returns the localizable description for this result set.
 IQResultSetMetaData getIQMetaData()
          Returns the IQ result set metadata.
 IQResultSetMetaData getIQMetaData(BusinessQuery businessQuery)
          Returns the IQ result set metadata.
 com.sas.util.LocalizableString getLabels(java.lang.String rsid)
          Returns the localizable label for this result set.
 java.lang.String getQuery()
          Returns the query string used to retrieve this resultset.
 java.lang.Object getResultSet()
          Returns the concrete result set object.
 java.util.Date getResultSetDate()
          Returns the date when the data was last generated.
 java.lang.String getSASLog()
          Returns the sas log from the most recent result set generation, or null if not available.
 java.lang.String getStoredProcessLog()
          Returns the SAS log pertaining to stored processes run as part of this query, or null if not set.
 com.sas.iquery.execution.instructions.StpNames getStpNames()
          Returns the stored process assigned names cache.
 int getType()
          Returns the type of the result set.
 

Field Detail

MULTI_DIMENSIONAL

static final java.lang.String MULTI_DIMENSIONAL
Returned by SimpleQueryConnector.getResultSetStructure(BusinessQuery) for multi-dimensional result sets (OLAP or ROLAP)

See Also:
Constant Field Values

TABULAR

static final java.lang.String TABULAR
Returned by SimpleQueryConnector.getResultSetStructure(BusinessQuery) for tabular result sets (relational data)

See Also:
Constant Field Values

MULTI_DIMENSIONAL_LIVE

static final int MULTI_DIMENSIONAL_LIVE
Returned by getType() for live (interactive and server connected) multi-dimensional result sets

See Also:
Constant Field Values

TABULAR_LIVE

static final int TABULAR_LIVE
Returned by getType()for live (interactive and server connected) tabular result sets

See Also:
Constant Field Values

TABULAR_EMBEDDED

static final int TABULAR_EMBEDDED
Returned by getType()for embedded (in-memory, non-server-connected) tabular result sets

See Also:
Constant Field Values

MULTI_DIMENSIONAL_EMBEDDED

static final int MULTI_DIMENSIONAL_EMBEDDED
Returned by getType()for embedded (in-memory, non-server-connected) multi-dimensional result set

See Also:
Constant Field Values
Method Detail

close

void close()
           throws ExecutionException
Close the result set.

The underlying concrete result set is also closed.

Throws:
ExecutionException - if an exception occurs during the close

getQuery

java.lang.String getQuery()
                          throws ExecutionException
Returns the query string used to retrieve this resultset.

The query string is likely to be specific for the server used and may contain SAS code, SQL, or MDX.

There is no guarantee that this code can simply be re-submitted to the server, as it may depend on a particular state of the server. The query string is intended for information and logging purposes only.

Returns:
the query string
Throws:
ExecutionException - if an error occurs

getResultSet

java.lang.Object getResultSet()
                              throws ExecutionException
Returns the concrete result set object. Users will have to cast to the underlying result set as necessary.

Returns:
the concrete result set, usually either ResultSet or OLAPDataSetInterface
Throws:
ExecutionException

getType

int getType()
            throws ExecutionException
Returns the type of the result set. The returned value may be one of

Returns:
A value indicating the type of the result set.
Throws:
ExecutionException - If the type cannot be determined

getResultSetDate

java.util.Date getResultSetDate()
                                throws ExecutionException
Returns the date when the data was last generated.

For queries that must be executed on a database server, this date may not be known until getResultSet() is called. This is true for parameterized queries. For queries with embedded data, this date is unknown if it was not persisted in the embedded data.

Returns:
the Date object representing the freshness of the data; null is returned if the date is unknown
Throws:
ExecutionException - if an error occurs
See Also:
getResultSet()

getStoredProcessLog

java.lang.String getStoredProcessLog()
                                     throws ExecutionException
Returns the SAS log pertaining to stored processes run as part of this query, or null if not set.

There is no guarantee that the stored process SAS log will be available.

Returns:
the stored process SAS execution log; null is returned if the SAS log is unavailable
Throws:
ExecutionException - if an error occurs

getSASLog

java.lang.String getSASLog()
                           throws ExecutionException
Returns the sas log from the most recent result set generation, or null if not available.

Returns:
the generated sas log; null is returned if the SAS log is not available
Throws:
ExecutionException - if an error occurs

getLabels

com.sas.util.LocalizableString getLabels(java.lang.String rsid)
                                         throws ExecutionException
Returns the localizable label for this result set.

Parameters:
rsid - the result set id for a column (if relational) or measure (if ROLAP or OLAP). This value can be retrieved from the relation's get column metadata name.
Returns:
a LocalizableString containing the label of the result set
Throws:
ExecutionException

getDescriptions

com.sas.util.LocalizableString getDescriptions(java.lang.String rsid)
                                               throws ExecutionException
Returns the localizable description for this result set.

Parameters:
rsid - The result set id for a column (if relational) or measure (if ROLAP or OLAP). This value can be retrieved from the relation's get column metadata name.
Returns:
a LocalizableString containing the description of the result set
Throws:
ExecutionException

getComputationalLocale

java.util.Locale getComputationalLocale()
Returns the Locale that the query computations were run under (or null if indeterminate).

Returns:
Locale used for query (or null if indeterminate)
See Also:
QueryConnectorInterface.getComputationalLocale(), BusinessModel.getComputationalLocale()

getStpNames

com.sas.iquery.execution.instructions.StpNames getStpNames()
Returns the stored process assigned names cache.

Returns:
StpNames

getIQMetaData

IQResultSetMetaData getIQMetaData()
                                  throws ExecutionException
Returns the IQ result set metadata. The IQResultSetMetadata contains additional metadata information, derived from the IQ model, over what is provided by the concrete result set metadata, either ResultSetMetadata or ResultSetMetadataInterface. A business query was applied to this result via the BusinessQueryProviderInterface object BusinessQueryProviderInterface that is stored in the result set.

Parameters:
business - query being used for this query or null.
Returns:
IQResultSetMetdata, the IQ derived metadata about this result set
Throws:
ExecutionException

getIQMetaData

IQResultSetMetaData getIQMetaData(BusinessQuery businessQuery)
                                  throws ExecutionException
Returns the IQ result set metadata. The IQResultSetMetadata contains additional metadata information, derived from the IQ model, over what is provided by the concrete result set metadata, either ResultSetMetadata or ResultSetMetadataInterface. A business query should be applied to get the data item match to the tuple element. If the business query was applied to this result set via the BusinessQueryProviderInterface object BusinessQueryProviderInterface, then a null can be submitted here.

Parameters:
business - query being used for this query or null.
Returns:
IQResultSetMetdata, the IQ derived metadata about this result set
Throws:
ExecutionException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.