public interface Statement
This interface is typically implemented by a MondrianOlap4jStatement, but not necessarily: statements may be created internally, not via olap4j.
Not part of Mondrian's public API. This class may change without notice.
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Issues a cancel request on this statement.
|
void |
checkCancelOrTimeout()
Deprecated.
This method will be removed in mondrian-4.0; use
Execution.checkCancelOrTimeout() |
void |
close()
Closes this statement.
|
void |
enableProfiling(ProfileHandler profileHandler)
Enables profiling.
|
void |
end(Execution execution)
Ends the current execution.
|
Execution |
getCurrentExecution()
Returns execution context if currently executing, null otherwise.
|
long |
getId()
Returns the ID of this statement, unique within the JVM.
|
RolapConnection |
getMondrianConnection()
Returns this statement's connection.
|
ProfileHandler |
getProfileHandler() |
Object |
getProperty(String name) |
Query |
getQuery() |
long |
getQueryTimeoutMillis()
Returns the query timeout of this statement, in milliseconds.
|
RolapSchema |
getSchema()
Returns this statement's schema.
|
SchemaReader |
getSchemaReader()
Returns this statement's schema reader.
|
void |
setQuery(Query query) |
void |
setQueryTimeoutMillis(long timeoutMillis)
Sets the timeout of this statement, in milliseconds.
|
void |
start(Execution execution)
Starts an execution.
|
void close()
SchemaReader getSchemaReader()
RolapSchema getSchema()
RolapConnection getMondrianConnection()
Query getQuery()
void setQuery(Query query)
void enableProfiling(ProfileHandler profileHandler)
Profiling information will be sent to the given writer when
Result.close()
is called.
If profileHandler is null, disables profiling.
profileHandler
- Writer to which to send profiling informationProfileHandler getProfileHandler()
void setQueryTimeoutMillis(long timeoutMillis)
Zero means no timeout.
Contrast with JDBC's Statement.setQueryTimeout(int)
method, which uses an int
value and a granularity of seconds.
timeoutMillis
- Timeout in millisecondslong getQueryTimeoutMillis()
Zero means no timeout.
Contrast with JDBC's Statement.getQueryTimeout()
method, which uses an int
value and a granularity of seconds.
void checkCancelOrTimeout()
Execution.checkCancelOrTimeout()
void cancel() throws SQLException
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.
SQLException
- on errorExecution getCurrentExecution()
void end(Execution execution)
execution
- Execution; must match the execution that was startedIllegalArgumentException
- if not started,
or if execution does not matchvoid start(Execution execution)
execution
- Execution contextlong getId()
Copyright © 2019 Hitachi Vantara. All rights reserved.