org.olap4j
public interface OlapStatement extends Statement, OlapWrapper
CellSet
.
An OlapStatement
is generally created using
OlapConnection.createStatement()
.
PreparedOlapStatement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
Modifier and Type | Method and Description |
---|---|
void |
addListener(CellSetListener.Granularity granularity,
CellSetListener listener)
Adds a listener to be notified of events to
CellSet s created by
this statement. |
CellSet |
executeOlapQuery(SelectNode selectNode)
Executes an OLAP statement expressed as a parse tree.
|
CellSet |
executeOlapQuery(String mdx)
Executes an OLAP statement.
|
OlapConnection |
getConnection()
Retrieves the
OlapConnection object
that produced this OlapStatement object. |
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
isWrapperFor, unwrap
isWrapperFor, unwrap
OlapConnection getConnection() throws SQLException
OlapConnection
object
that produced this OlapStatement
object.getConnection
in interface Statement
SQLException
CellSet executeOlapQuery(String mdx) throws OlapException
mdx
- MDX SELECT
statementOlapException
- if a database access error occurs,
this method is called on a closed OlapStatement
,
the query times out (see Statement.setQueryTimeout(int)
)
or another thread cancels the statement (see Statement.cancel()
)CellSet executeOlapQuery(SelectNode selectNode) throws OlapException
Validates the parse tree before executing it.
selectNode
- Parse tree of MDX SELECT
statementOlapException
- if a database access error occurs,
this method is called on a closed OlapStatement
,
the query times out (see Statement.setQueryTimeout(int)
)
or another thread cancels the statement (see Statement.cancel()
)void addListener(CellSetListener.Granularity granularity, CellSetListener listener) throws OlapException
CellSet
s created by
this statement.
NOTE: You may wonder why this method belongs to the
OlapStatement
class and not CellSet
. If the method
belonged to CellSet
there would be a window between creation and
registering a listener during which events might be lost, whereas
registering the listener with the statement ensures that the listener is
attached immediately that the cell set is opened. It follows that
registering a listener does not affect the cell set currently
open (if any), and that no events will be received if the statement
has no open cell sets.
granularity
- Granularity of cell set events to listen forlistener
- Listener to be notified of changesOlapException
- if granularity is not one supported by this server,
per the
OlapDatabaseMetaData.getSupportedCellSetListenerGranularities()
method