abstract class MondrianOlap4jStatement extends StatementImpl implements OlapStatement, Statement
OlapStatement
for the Mondrian OLAP engine.Modifier and Type | Field and Description |
---|---|
protected boolean |
closeOnCompletion
Support for
Statement.closeOnCompletion() method. |
(package private) MondrianOlap4jConnection |
olap4jConnection |
(package private) MondrianOlap4jCellSet |
openCellSet
Current cell set, or null if the statement is not executing anything.
|
query, queryTimeout
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
Constructor and Description |
---|
MondrianOlap4jStatement(MondrianOlap4jConnection olap4jConnection) |
Modifier and Type | Method and Description |
---|---|
void |
addBatch(String sql) |
void |
addListener(CellSetListener.Granularity granularity,
CellSetListener cellSetListener) |
void |
cancel()
Issues a cancel request on this statement.
|
void |
clearBatch() |
void |
clearWarnings() |
void |
close()
Closes this statement.
|
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch() |
CellSet |
executeOlapQuery(SelectNode selectNode) |
CellSet |
executeOlapQuery(String mdx) |
protected CellSet |
executeOlapQueryInternal(Query query,
MondrianOlap4jCellSetMetaData cellSetMetaData)
Executes a parsed query, closing any previously open cellset.
|
ResultSet |
executeQuery(String mdx) |
(package private) ResultSet |
executeQuery2(String mdx,
boolean advanced,
String tabFields,
int[] rowCountSlot) |
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
OlapConnection |
getConnection() |
int |
getFetchDirection() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys() |
int |
getMaxFieldSize() |
int |
getMaxRows() |
RolapConnection |
getMondrianConnection()
Returns this statement's connection.
|
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
int |
getQueryTimeout() |
ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
int |
getUpdateCount() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isPoolable() |
boolean |
isWrapperFor(Class<?> iface) |
(package private) void |
onResultSetClose(ResultSet resultSet)
Called by each child result set (most likely a cell set) when it is
closed.
|
protected Pair<Query,MondrianOlap4jCellSetMetaData> |
parseQuery(String mdx) |
void |
setCursorName(String name) |
void |
setEscapeProcessing(boolean enable) |
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int max) |
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds) |
void |
start(Execution execution)
Starts an execution.
|
<T> T |
unwrap(Class<T> iface) |
checkCancelOrTimeout, enableProfiling, end, getCurrentExecution, getId, getProfileHandler, getProperty, getQuery, getQueryTimeoutMillis, getSchema, getSchemaReader, setQuery, setQueryTimeoutMillis
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeOnCompletion, isCloseOnCompletion
checkCancelOrTimeout, enableProfiling, end, getCurrentExecution, getId, getProfileHandler, getProperty, getQuery, getQueryTimeoutMillis, getSchema, getSchemaReader, setQuery, setQueryTimeoutMillis
final MondrianOlap4jConnection olap4jConnection
protected boolean closeOnCompletion
Statement.closeOnCompletion()
method.MondrianOlap4jCellSet openCellSet
MondrianOlap4jStatement(MondrianOlap4jConnection olap4jConnection)
public ResultSet executeQuery(String mdx) throws SQLException
SQLException
ResultSet executeQuery2(String mdx, boolean advanced, String tabFields, int[] rowCountSlot) throws SQLException
SQLException
public int executeUpdate(String sql) throws SQLException
SQLException
public void close()
Statement
close
in interface AutoCloseable
close
in interface Statement
public int getMaxFieldSize() throws SQLException
SQLException
public void setMaxFieldSize(int max) throws SQLException
SQLException
public int getMaxRows() throws SQLException
SQLException
public void setMaxRows(int max) throws SQLException
SQLException
public void setEscapeProcessing(boolean enable) throws SQLException
SQLException
public int getQueryTimeout() throws SQLException
SQLException
public void setQueryTimeout(int seconds) throws SQLException
SQLException
public void cancel() throws SQLException
Statement
Once the thread running the statement detects the cancel request,
execution will throw an exception. See
BasicQueryTest.testCancel
for an example of usage of this
method.
cancel
in interface Statement
cancel
in class StatementImpl
SQLException
- on errorpublic SQLWarning getWarnings() throws SQLException
SQLException
public void clearWarnings() throws SQLException
SQLException
public void setCursorName(String name) throws SQLException
SQLException
public boolean execute(String sql) throws SQLException
SQLException
public ResultSet getResultSet() throws SQLException
SQLException
public int getUpdateCount() throws SQLException
SQLException
public boolean getMoreResults() throws SQLException
SQLException
public void setFetchDirection(int direction) throws SQLException
SQLException
public int getFetchDirection() throws SQLException
SQLException
public void setFetchSize(int rows) throws SQLException
SQLException
public int getFetchSize() throws SQLException
SQLException
public int getResultSetConcurrency() throws SQLException
SQLException
public int getResultSetType() throws SQLException
SQLException
public void addBatch(String sql) throws SQLException
SQLException
public void clearBatch() throws SQLException
SQLException
public int[] executeBatch() throws SQLException
SQLException
public OlapConnection getConnection()
getConnection
in interface OlapStatement
public boolean getMoreResults(int current) throws SQLException
SQLException
public ResultSet getGeneratedKeys() throws SQLException
SQLException
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
SQLException
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
SQLException
public int executeUpdate(String sql, String[] columnNames) throws SQLException
SQLException
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
SQLException
public boolean execute(String sql, int[] columnIndexes) throws SQLException
SQLException
public boolean execute(String sql, String[] columnNames) throws SQLException
SQLException
public int getResultSetHoldability() throws SQLException
SQLException
public boolean isClosed() throws SQLException
SQLException
public void setPoolable(boolean poolable) throws SQLException
SQLException
public boolean isPoolable() throws SQLException
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
unwrap
in interface OlapWrapper
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
isWrapperFor
in interface OlapWrapper
SQLException
public CellSet executeOlapQuery(String mdx) throws OlapException
executeOlapQuery
in interface OlapStatement
OlapException
protected Pair<Query,MondrianOlap4jCellSetMetaData> parseQuery(String mdx) throws OlapException
OlapException
protected CellSet executeOlapQueryInternal(Query query, MondrianOlap4jCellSetMetaData cellSetMetaData) throws OlapException
OlapException
- if a database error occursquery
- Parsed querycellSetMetaData
- Cell set metadatapublic void start(Execution execution)
Statement
start
in interface Statement
start
in class StatementImpl
execution
- Execution contextpublic CellSet executeOlapQuery(SelectNode selectNode) throws OlapException
executeOlapQuery
in interface OlapStatement
OlapException
public void addListener(CellSetListener.Granularity granularity, CellSetListener cellSetListener) throws OlapException
addListener
in interface OlapStatement
OlapException
public RolapConnection getMondrianConnection()
Statement
getMondrianConnection
in interface Statement
void onResultSetClose(ResultSet resultSet)
resultSet
- Result set or cell set