Interface Statement

All Known Implementing Classes:
StatementImpl

public interface Statement
Internal context corresponding to a 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.

Author:
jhyde
  • Method Details

    • close

      void close()
      Closes this statement.
    • getSchemaReader

      SchemaReader getSchemaReader()
      Returns this statement's schema reader.
      Returns:
      Schema reader, not null
    • getSchema

      RolapSchema getSchema()
      Returns this statement's schema.
      Returns:
      Schema, not null
    • getMondrianConnection

      RolapConnection getMondrianConnection()
      Returns this statement's connection.
      Returns:
      connection
    • getProperty

      Object getProperty(String name)
    • getQuery

      Query getQuery()
    • setQuery

      void setQuery(Query query)
    • enableProfiling

      void enableProfiling(ProfileHandler profileHandler)
      Enables profiling.

      Profiling information will be sent to the given writer when Result.close() is called.

      If profileHandler is null, disables profiling.

      Parameters:
      profileHandler - Writer to which to send profiling information
    • getProfileHandler

      ProfileHandler getProfileHandler()
    • setQueryTimeoutMillis

      void setQueryTimeoutMillis(long timeoutMillis)
      Sets the timeout of this statement, in milliseconds.

      Zero means no timeout.

      Contrast with JDBC's Statement.setQueryTimeout(int) method, which uses an int value and a granularity of seconds.

      Parameters:
      timeoutMillis - Timeout in milliseconds
    • getQueryTimeoutMillis

      long getQueryTimeoutMillis()
      Returns the query timeout of this statement, in milliseconds.

      Zero means no timeout.

      Contrast with JDBC's Statement.getQueryTimeout() method, which uses an int value and a granularity of seconds.

      Returns:
      Timeout in milliseconds
    • checkCancelOrTimeout

      void checkCancelOrTimeout()
      Deprecated.
      This method will be removed in mondrian-4.0; use Execution.checkCancelOrTimeout()
      Checks if either a cancel request has been issued on the query or the execution time has exceeded the timeout value (if one has been set). Exceptions are raised if either of these two conditions are met. This method should be called periodically during query execution to ensure timely detection of these events, particularly before/after any potentially long running operations.
    • cancel

      void cancel() throws SQLException
      Issues a cancel request on this 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.

      Throws:
      SQLException - on error
    • getCurrentExecution

      Execution getCurrentExecution()
      Returns execution context if currently executing, null otherwise.
      Returns:
      Execution context
    • end

      void end(Execution execution)
      Ends the current execution.
      Parameters:
      execution - Execution; must match the execution that was started
      Throws:
      IllegalArgumentException - if not started, or if execution does not match
    • start

      void start(Execution execution)
      Starts an execution.
      Parameters:
      execution - Execution context
    • getId

      long getId()
      Returns the ID of this statement, unique within the JVM.
      Returns:
      Unique ID of this statement