Package org.olap4j
Interface OlapStatement
-
- All Superinterfaces:
java.lang.AutoCloseable
,OlapWrapper
,java.sql.Statement
,java.sql.Wrapper
- All Known Subinterfaces:
PreparedOlapStatement
public interface OlapStatement extends java.sql.Statement, OlapWrapper
Object used for statically executing an MDX statement and returning aCellSet
.An
OlapStatement
is generally created usingOlapConnection.createStatement()
.- Since:
- Aug 22, 2006
- Author:
- jhyde
- See Also:
PreparedOlapStatement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(CellSetListener.Granularity granularity, CellSetListener listener)
Adds a listener to be notified of events toCellSet
s created by this statement.CellSet
executeOlapQuery(java.lang.String mdx)
Executes an OLAP statement.CellSet
executeOlapQuery(SelectNode selectNode)
Executes an OLAP statement expressed as a parse tree.OlapConnection
getConnection()
Retrieves theOlapConnection
object that produced thisOlapStatement
object.-
Methods inherited from interface org.olap4j.OlapWrapper
isWrapperFor, unwrap
-
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
-
-
-
Method Detail
-
getConnection
OlapConnection getConnection() throws java.sql.SQLException
Retrieves theOlapConnection
object that produced thisOlapStatement
object.- Specified by:
getConnection
in interfacejava.sql.Statement
- Throws:
java.sql.SQLException
-
executeOlapQuery
CellSet executeOlapQuery(java.lang.String mdx) throws OlapException
Executes an OLAP statement.- Parameters:
mdx
- MDXSELECT
statement- Returns:
- Cell set
- Throws:
OlapException
- if a database access error occurs, this method is called on a closedOlapStatement
, the query times out (seeStatement.setQueryTimeout(int)
) or another thread cancels the statement (seeStatement.cancel()
)
-
executeOlapQuery
CellSet executeOlapQuery(SelectNode selectNode) throws OlapException
Executes an OLAP statement expressed as a parse tree.Validates the parse tree before executing it.
- Parameters:
selectNode
- Parse tree of MDXSELECT
statement- Returns:
- Cell set
- Throws:
OlapException
- if a database access error occurs, this method is called on a closedOlapStatement
, the query times out (seeStatement.setQueryTimeout(int)
) or another thread cancels the statement (seeStatement.cancel()
)
-
addListener
void addListener(CellSetListener.Granularity granularity, CellSetListener listener) throws OlapException
Adds a listener to be notified of events toCellSet
s created by this statement.NOTE: You may wonder why this method belongs to the
OlapStatement
class and notCellSet
. If the method belonged toCellSet
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.- Parameters:
granularity
- Granularity of cell set events to listen forlistener
- Listener to be notified of changes- Throws:
OlapException
- if granularity is not one supported by this server, per theOlapDatabaseMetaData.getSupportedCellSetListenerGranularities()
method
-
-