|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.olap.sasmdx.OLAPDataSet
public class OLAPDataSet
Contains the client side implementation for com.sas.storage.olap.OLAPDataSetInterface and the PerformanceTuningInterface. This implementation uses the IOM/OLAP interfaces provided by the SAS OLAP server.
Field Summary |
---|
Fields inherited from interface com.sas.storage.olap.OLAPDataSetInterface |
---|
DEFAULT_CONTEXT_TYPE, NO_CONTEXT_TYPE |
Fields inherited from interface com.sas.storage.olap.ResultSetInterface |
---|
DEFAULT_END_CELL, DEFAULT_ENDCELL |
Constructor Summary | |
---|---|
OLAPDataSet()
default constructor |
|
OLAPDataSet(java.lang.Object connection)
Create a OLAPDataSet object with the connection that is IMDXServer or ISession object |
|
OLAPDataSet(java.lang.Object connection,
java.util.Locale locale,
java.lang.String queryStatement)
Create an OLAPDataSet with the passed in connection and query |
|
OLAPDataSet(java.lang.Object connection,
java.util.Locale locale,
java.lang.String queryStatement,
int contextType)
Create an OLAPDataSet with the passed in connection and query |
|
OLAPDataSet(java.lang.Object connection,
java.lang.String queryStatement)
Create an OLAPDataSet with the passed in connection and query |
|
OLAPDataSet(java.lang.Object connection,
java.lang.String queryStatement,
int contextType)
Create an OLAPDataSet with the passed in connection and query |
|
OLAPDataSet(java.lang.Object connection,
java.lang.String queryStatement,
java.lang.String queryId)
Create an OLAPDataSet with the passed in connection and query |
|
OLAPDataSet(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Create an OLAPDataSet with passed in connection properties. |
|
OLAPDataSet(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.util.Locale locale,
java.lang.String queryStatement)
Create an OLAPDataSet with passed in connection properties. |
|
OLAPDataSet(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password,
java.lang.String queryStatement)
Create an OLAPDataSet with passed in connection properties. |
Method Summary | |
---|---|
void |
cancelQuery()
|
void |
close()
Closes the result set and clears the cache |
void |
executeQuery()
Executes a query that is set, using the setQueryStatement. |
void |
executeQuery(java.lang.String queryStatement)
Execute a passed in query. |
void |
executeQuery(java.lang.String queryStatement,
java.lang.String queryId)
QueryStatement should have queryID appended to it otherwise the id will be ignored. |
long |
getCellCount()
Get the number of cells for the query. |
java.lang.Object[] |
getCells(long startCell,
long endCell)
Get the unformatted cells starting at the start Ordinal upto end ordinal. |
java.lang.Object |
getConnection()
Get the connection(IMDXServer) or session(ISession) object set on this class. |
int |
getContextType()
Get the context type for this md dataset |
java.lang.String |
getCubeName()
Get the cubename for this 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.lang.String[] |
getFormattedCells(long startCell,
long endCell)
Get the formatted cells starting at the start Ordinal upto end ordinal. |
java.util.Locale |
getLocale()
Return the locale used to create a session object |
PerformanceTuning |
getPerformanceTuning()
This method returns a performanceTuning object on the model. |
java.lang.String |
getQueryId()
|
java.lang.String |
getQueryStatement()
Returns the most recent query statement. |
ResultSetMetadataInterface |
getResultSetMetadata()
Returns the metadata that defines the structure of the ResultSet |
java.lang.String |
getTotalLabel()
Get the total label set on the result set elements |
boolean |
isReadOnly()
This implementation will always return true. |
void |
setCells(long startCell,
long endCell,
java.lang.Object[] cellValues)
This method is not supported |
void |
setConnection(java.lang.Object connection)
This method can use a connection object or a session object associated with a connection. |
void |
setContextType(int contextType)
Set the contextType for this dataSet. |
void |
setFormattedCells(long startCell,
long endCell,
java.lang.String[] cellValues)
This is not supported |
void |
setLocale(java.util.Locale locale)
Set the Locale used to create the session. |
void |
setPerformanceTuning(PerformanceTuning performanceTuning)
Set the PerformanceTuning Object on this model. |
void |
setQueryStatement(java.lang.String queryStatement)
Set the query statement. |
void |
setQueryStatement(java.lang.String queryStatement,
java.lang.String queryID)
|
void |
setQueryStatement(java.lang.String queryStatement,
java.lang.String queryID,
java.util.Map<java.lang.String,java.lang.String> measureLabelMap)
QueryStatement should have queryID appended to it otherwise the id will be ignored. |
void |
setReadOnly(boolean readOnly)
The readOnly state may only be set to true. |
void |
setTotalLabel(java.lang.String label)
A convenience method to set the Total Label on the resultset element. |
Constructor Detail |
---|
public OLAPDataSet() throws OLAPException
OLAPException
public OLAPDataSet(java.lang.Object connection) throws OLAPException
connection
- OLAPConnection
OLAPException
public OLAPDataSet(java.lang.Object connection, java.lang.String queryStatement) throws OLAPException
connection
- OLAPConnection associated with this OLAPDataSet or ISession
associated with the connectionqueryStatement
- query for this OLAPDataSet
OLAPException
public OLAPDataSet(java.lang.Object connection, java.lang.String queryStatement, java.lang.String queryId) throws OLAPException
connection
- OLAPConnection associated with this OLAPDataSet or ISession
associated with the connectionqueryStatement
- query for this OLAPDataSet
OLAPException
public OLAPDataSet(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws OLAPException
host
- connection hostport
- connection portusername
- connection usernamepassword
- connection password
OLAPException
public OLAPDataSet(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.lang.String queryStatement) throws OLAPException
host
- connection hostport
- connection portusername
- connection usernamepassword
- connection passwordqueryStatement
- query for this dataset
OLAPException
public OLAPDataSet(java.lang.Object connection, java.util.Locale locale, java.lang.String queryStatement) throws OLAPException
connection
- a connection associated with this OLAPDataSet. The connection can
be IMDXServer or ISession object.Locale
- to be used with the connectionqueryStatement
- query for this OLAPDataSet
OLAPException
public OLAPDataSet(java.lang.String host, int port, java.lang.String username, java.lang.String password, java.util.Locale locale, java.lang.String queryStatement) throws OLAPException
host
- connection hostport
- connection portusername
- connection usernamepassword
- connection passwordLocale
- to be used with the connectionqueryStatement
- query for this dataset
OLAPException
public OLAPDataSet(java.lang.Object connection, java.util.Locale locale, java.lang.String queryStatement, int contextType) throws OLAPException
connection
- a connection associated with this OLAPDataSet. The connection can
be IMDXServer or ISession object.Locale
- to be used with the connectionqueryStatement
- query for this OLAPDataSet
OLAPException
public OLAPDataSet(java.lang.Object connection, java.lang.String queryStatement, int contextType) throws OLAPException
connection
- OLAPConnection associated with this OLAPDataSet or ISession
associated with the connectionqueryStatement
- query for this OLAPDataSet
OLAPException
Method Detail |
---|
public void setContextType(int contextType) throws OLAPException
setContextType
in interface OLAPDataSetInterface
contextType
- Currently only two context types defined, DEFAULT_CONTEXT_TYPE
and NO_CONTEXT_TYPE
OLAPException
public int getContextType() throws OLAPException
getContextType
in interface OLAPDataSetInterface
OLAPException
public void setLocale(java.util.Locale locale) throws OLAPException
setLocale
in interface OLAPDataSetInterface
OLAPException
- if a database error occurspublic java.util.Locale getLocale() throws OLAPException
getLocale
in interface OLAPDataSetInterface
OLAPException
- if a database error occurspublic java.lang.Object getConnection() throws OLAPException
getConnection
in interface OLAPDataSetInterface
OLAPException
- if a database error occurspublic void setConnection(java.lang.Object connection) throws OLAPException
setConnection
in interface OLAPDataSetInterface
connection
- the connection can be either IMDXServer or ISession
OLAPException
- if a database error occurspublic java.lang.String getQueryId()
public void executeQuery(java.lang.String queryStatement, java.lang.String queryId) throws OLAPException
queryStatement
- a complete uery including the idqueryId
- queryid to be used by sub queries (ancestor query)
OLAPException
public void executeQuery(java.lang.String queryStatement) throws OLAPException
executeQuery
in interface OLAPDataSetInterface
mdx
- statement
OLAPException
- if a database error occurspublic void setTotalLabel(java.lang.String label)
label
- to use for the Total elementpublic java.lang.String getTotalLabel()
public java.lang.String getCubeName() throws OLAPException
getCubeName
in interface OLAPDataSetInterface
OLAPException
- if the cubename cannot bepublic void executeQuery() throws OLAPException
executeQuery
in interface OLAPDataSetInterface
OLAPException
- if a database error occurspublic void setQueryStatement(java.lang.String queryStatement) throws OLAPException
setQueryStatement
in interface OLAPDataSetInterface
queryStatement
- The query to be executed
OLAPException
- if a database error occurspublic void setQueryStatement(java.lang.String queryStatement, java.lang.String queryID) throws OLAPException
OLAPException
public void setQueryStatement(java.lang.String queryStatement, java.lang.String queryID, java.util.Map<java.lang.String,java.lang.String> measureLabelMap) throws OLAPException
queryStatement
- a complete query including the idqueryId
- queryid to be used by sub queries (ancestor query)measureLabelMap
- a map containing measure uniqueName as keys and associated label as value.
For example ("[Measures]. [ACTUAL_SALES]"-= "Actual Sales"). Null values are not allowed. The values will be
used for the associated query. If the key does not match any measure in the metadata for the cube, the label will be ignored and
label from the server will be used.
OLAPException
- for database error or null values in the measureLabelmappublic void setReadOnly(boolean readOnly) throws OLAPException
setReadOnly
in interface OLAPDataSetInterface
readOnly
- The updateable state of the OLAPDataSet.
OLAPException
- If a database-access error occurspublic ResultSetMetadataInterface getResultSetMetadata() throws OLAPException
ResultSetInterface
getResultSetMetadata
in interface ResultSetInterface
OLAPException
- if a database error occurspublic java.lang.String getQueryStatement() throws OLAPException
ResultSetInterface
getQueryStatement
in interface ResultSetInterface
OLAPException
- if a database error occurspublic boolean isReadOnly() throws OLAPException
isReadOnly
in interface ResultSetInterface
OLAPException
- If a database-access error occurspublic java.lang.Object[] getCells(long startCell, long endCell) throws OLAPException
getCells
in interface ResultSetInterface
startCell
- A zero-based ordinal position for the starting cell.endCell
- A zero-based ordinal position for the ending cell where DEFAULT_ENDCELL can be used to
indicate all remaining cells
OLAPException
- if a database error occurspublic java.lang.String[] getFormattedCells(long startCell, long endCell) throws OLAPException
getFormattedCells
in interface ResultSetInterface
startCell
- A zero-based ordinal position for the starting cell.endCell
- A zero-based ordinal position for the ending cell where DEFAULT_ENDCELL can be used to
indicate all remaining cells
OLAPException
- if a database error occurspublic long getCellCount() throws OLAPException
getCellCount
in interface ResultSetInterface
OLAPException
- if a database error occurspublic void setCells(long startCell, long endCell, java.lang.Object[] cellValues) throws OLAPException
setCells
in interface ResultSetInterface
startCell
- A zero-based ordinal position for the starting cell.endCell
- A zero-based ordinal position for the ending cell.cellValues
- Sets the values for the cells.
OLAPException
- if a database error occurspublic void setFormattedCells(long startCell, long endCell, java.lang.String[] cellValues) throws OLAPException
setFormattedCells
in interface ResultSetInterface
startCell
- A zero-based ordinal position for the starting cell.endCell
- A zero-based ordinal position for the ending cell.cellValues
- Sets the formatted values for the cells.
OLAPException
- if a database error occurspublic void close() throws OLAPException
close
in interface ResultSetInterface
OLAPException
- if a database error occurspublic PerformanceTuning getPerformanceTuning() throws OLAPException
getPerformanceTuning
in interface OLAPDataSetInterface
OLAPException
public void setPerformanceTuning(PerformanceTuning performanceTuning) throws OLAPException
setPerformanceTuning
in interface OLAPDataSetInterface
perfromanceTuning
- An Object that has performanceTuning properties set on it. Null will
not have any effect.
OLAPException
public MetadataInterface getDatabaseMetadata() throws OLAPException
OLAPDataSetInterface
getDatabaseMetadata
in interface OLAPDataSetInterface
OLAPException
- If a database error occurspublic void cancelQuery() throws OLAPException
OLAPException
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |