com.sas.storage.olap
Interface OLAPDataSetInterface

All Superinterfaces:
ResultSetInterface
All Known Implementing Classes:
GraphOLAPDataSet, OLAPDataSet, OLAPDataSet

public interface OLAPDataSetInterface
extends ResultSetInterface

The OLAPDataSetInterface together with the ResultSetInterface, ResultSetMetadataInterface, AxisInterface, TupleInterface, and TupleElementInterface make up the Data portion of the OLAP model. The ResultSetInterface is the central interface for retrieving the data and the structure or shape of that data. The structure of the data is defined by the ResultSetMetadataInterface, which is directly accessible via the ResultSetInterface. The AxisInterface, TupleInterface, and TupleElementInterface are the metadata components for the ResultSetMetadata. These are distinctly different from the metadata that defines the dataSource (eg Cube, Dimension, etc), as is noted throughout the javadoc. The OLAPDataSetInterface brings them all together. It provides the connection information and the means to execute a query on an OLAP server. An OLAPDataSet object is the Java Data Model that should be attached to OLAP viewers, roughly equivalent to a JDBC RowSet. The OLAPDataSetInterface extends the functionality of the ResultSetInterface. It also provides a set of properties that allow an OLAPDataSet instance to be configured to connect to an OLAP server. A connection, however, is not required in order to use this model. When a connection is defined, the OLAPDataSet is used for executing a static query statement and obtaining the results produced by it. Only one ResultSet is available within the OLAPDataSetInterface at any point in time. Therefore, if the reading of one ResultSet object is interleaved with the reading of another, each must have been generated by different OLAPDataSetInterface objects. The executeQuery method implicitly closes the previous ResultSet object.

See Also:
ResultSetInterface

Field Summary
static int DEFAULT_CONTEXT_TYPE
          The following properties specify whether the tupleelement in the resultset has context or not.
static int NO_CONTEXT_TYPE
           
 
Fields inherited from interface com.sas.storage.olap.ResultSetInterface
DEFAULT_END_CELL, DEFAULT_ENDCELL
 
Method Summary
 void executeQuery()
          Executes the current query statement, which can be retrieved via the getQueryStatement() method.
 void executeQuery(java.lang.String queryStatement)
          Executes the query statement that is passed in as a parameter.
 java.lang.Object getConnection()
          Returns the connection to the OLAP server.
 int getContextType()
          Get the context type.
 java.lang.String getCubeName()
          Get the cubename associated with the current query
 MetadataInterface getDatabaseMetadata()
          This method returns an instance of the MetadataInterface which defines all of the Cubes' metadata on the OLAP Server to which the model is connected.
 java.util.Locale getLocale()
          Returns the locale used for the session.
 PerformanceTuning getPerformanceTuning()
          This method returns a performanceTuning object on the model.
 void setConnection(java.lang.Object con)
          Sets the connection to the OLAP server.
 void setContextType(int contextType)
          Set the context type.
 void setLocale(java.util.Locale locale)
          Sets the locale for the session object
 void setPerformanceTuning(PerformanceTuning performanceTuning)
          Set the PerformanceTuning Object on this model.
 void setQueryStatement(java.lang.String queryStatement)
          Sets the query statement, but does not execute the query.
 void setReadOnly(boolean readOnly)
          Sets the updateable state of the OLAPDataSet.
 
Methods inherited from interface com.sas.storage.olap.ResultSetInterface
close, getCellCount, getCells, getFormattedCells, getQueryStatement, getResultSetMetadata, isReadOnly, setCells, setFormattedCells
 

Field Detail

DEFAULT_CONTEXT_TYPE

static final int DEFAULT_CONTEXT_TYPE
The following properties specify whether the tupleelement in the resultset has context or not. For example, a tupleElement Jan will be displayed as '1997.Jan' if it is with context and simply 'Jan' if has no context.

See Also:
Constant Field Values

NO_CONTEXT_TYPE

static final int NO_CONTEXT_TYPE
See Also:
Constant Field Values
Method Detail

setContextType

void setContextType(int contextType)
                    throws OLAPException
Set the context type. The context type determines whether a tuple element in the resultset has context applied to it or not. For example, a tupleElement Jan will be displayed as '1997.Jan' if it is with context and simply 'Jan' if has no context.

Parameters:
context - type to be set on the resultSet. Currently there are only two types, DEFAULT_CONTEXT_TYPE and NO_CONTEXT_TYPE
Throws:
OLAPException - if cannot set the context type.

getContextType

int getContextType()
                   throws OLAPException
Get the context type.

Returns:
context type set on the resultSet. Currently there are only two types, DEFAULT_CONTEXT_TYPE and NO_CONTEXT_TYPE
Throws:
OLAPException - if cannot set the context type.

getConnection

java.lang.Object getConnection()
                               throws OLAPException
Returns the connection to the OLAP server. This value may be null in cases where the OLAPDataSet in not connected.

Returns:
The connection to the OLAP server
Throws:
OLAPException - if a database error occurs

setConnection

void setConnection(java.lang.Object con)
                   throws OLAPException
Sets the connection to the OLAP server.

Parameters:
The - connection to the OLAP server
Throws:
OLAPException - if a database error occurs

getLocale

java.util.Locale getLocale()
                           throws OLAPException
Returns the locale used for the session.

Returns:
The locale to the OLAP server
Throws:
OLAPException - if a database error occurs

setLocale

void setLocale(java.util.Locale locale)
               throws OLAPException
Sets the locale for the session object

Parameters:
The - locale to the OLAP server
Throws:
OLAPException - if a database error occurs

executeQuery

void executeQuery(java.lang.String queryStatement)
                  throws OLAPException
Executes the query statement that is passed in as a parameter. The execution of this query will generate a new ResultSet. This method will implicitly close the current ResultSet object if an open one exists.

Parameters:
queryStatement - The query statement
Throws:
OLAPException - if a database error occurs

executeQuery

void executeQuery()
                  throws OLAPException
Executes the current query statement, which can be retrieved via the getQueryStatement() method. The execution of this query will generate a new ResultSet. This method will implicitly close the current ResultSet object if an open one exists.

Throws:
OLAPException - if a database error occurs

setQueryStatement

void setQueryStatement(java.lang.String queryStatement)
                       throws OLAPException
Sets the query statement, but does not execute the query. To execute the query, use the executeQuery() method. If the query statement is set, but not executed the ResultSet object will not be in sync with the queryStatement property. The ResultSet is a reflection of the last query that was executed.

Parameters:
queryStatement - The query to be executed
Throws:
OLAPException - if a database error occurs

setReadOnly

void setReadOnly(boolean readOnly)
                 throws OLAPException
Sets the updateable state of the OLAPDataSet. Not all OLAPDataSetInterfaces are updateable, and an OLAPException will be thrown if updates are not supported and readOnly is set to false.

Parameters:
readOnly - The updateable state of the OLAPDataSet.
Throws:
OLAPException - If a database-access error occurs

getPerformanceTuning

PerformanceTuning getPerformanceTuning()
                                       throws OLAPException
This method returns a performanceTuning object on the model. This can be null if the query has not been set. User can create a new PerformanceTuning object and set it on the model. The returned object may be different than the set object, in case of it being set on multiple models. The model checks for an existence of model (property) on the passed in object and if there is one, it makes a copy of the passed in object and sets it on this model. In other words there is one to one relationship between model and the performance tuning object.

Returns:
performanceTuning object
Throws:
OLAPException

setPerformanceTuning

void setPerformanceTuning(PerformanceTuning performanceTuning)
                          throws OLAPException
Set the PerformanceTuning Object on this model. Nothing will happen if the object is null. Since each instance of model has its own performance tuning, if this object is derived from another model or it is already set on another model, a copy of the perfroamnceTuning object will be made before setting it on this model. In other words, a get may not return the same object as the set.

Parameters:
perfromanceTuning - An Object that has performanceTuning properties set on it. Null will not have any effect.
Throws:
OLAPException

getDatabaseMetadata

MetadataInterface getDatabaseMetadata()
                                      throws OLAPException
This method returns an instance of the MetadataInterface which defines all of the Cubes' metadata on the OLAP Server to which the model is connected. Implementations which do not support this MetadataInterface should return null.

Returns:
metadata An instance of the MetadataInterface that shares the same connection as the Data Model
Throws:
OLAPException - If a database error occurs

getCubeName

java.lang.String getCubeName()
                             throws OLAPException
Get the cubename associated with the current query

Returns:
cubename associated with the current query
Throws:
OLAPException - if the cubename cannot be



Copyright © 2009 SAS Institute Inc. All Rights Reserved.