Class MondrianOlap4jConnection

java.lang.Object
mondrian.olap4j.MondrianOlap4jConnection
All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, org.olap4j.OlapConnection, org.olap4j.OlapWrapper

public abstract class MondrianOlap4jConnection extends Object implements org.olap4j.OlapConnection
Implementation of OlapConnection for the Mondrian OLAP engine.

This class has sub-classes which implement JDBC 3.0 and JDBC 4.0 APIs; it is instantiated using Factory.newConnection(MondrianOlap4jDriver, String, java.util.Properties).

This class is public, to allow access to the setRoleNames(java.util.List) method before it is added to olap4j version 2.0. This may change without notice. Code should not rely on this class being public.

Since:
May 23, 2007
Author:
jhyde
  • Method Details

    • createStatement

      public org.olap4j.OlapStatement createStatement()
      Specified by:
      createStatement in interface Connection
      Specified by:
      createStatement in interface org.olap4j.OlapConnection
    • createScenario

      public ScenarioImpl createScenario() throws org.olap4j.OlapException
      Specified by:
      createScenario in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • setScenario

      public void setScenario(org.olap4j.Scenario scenario) throws org.olap4j.OlapException
      Specified by:
      setScenario in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • getScenario

      public org.olap4j.Scenario getScenario() throws org.olap4j.OlapException
      Specified by:
      getScenario in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • prepareStatement

      public PreparedStatement prepareStatement(String sql)
      Specified by:
      prepareStatement in interface Connection
    • prepareCall

      public CallableStatement prepareCall(String sql)
      Specified by:
      prepareCall in interface Connection
    • nativeSQL

      public String nativeSQL(String sql)
      Specified by:
      nativeSQL in interface Connection
    • setAutoCommit

      public void setAutoCommit(boolean autoCommit)
      Specified by:
      setAutoCommit in interface Connection
    • getAutoCommit

      public boolean getAutoCommit()
      Specified by:
      getAutoCommit in interface Connection
    • commit

      public void commit()
      Specified by:
      commit in interface Connection
    • rollback

      public void rollback()
      Specified by:
      rollback in interface Connection
    • close

      public void close() throws SQLException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Connection
      Throws:
      SQLException
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface Connection
    • getMetaData

      public org.olap4j.OlapDatabaseMetaData getMetaData()
      Specified by:
      getMetaData in interface Connection
      Specified by:
      getMetaData in interface org.olap4j.OlapConnection
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface Connection
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface Connection
    • setSchema

      public void setSchema(String schemaName)
      Specified by:
      setSchema in interface Connection
      Specified by:
      setSchema in interface org.olap4j.OlapConnection
    • getSchema

      public String getSchema() throws org.olap4j.OlapException
      Specified by:
      getSchema in interface Connection
      Specified by:
      getSchema in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • getOlapSchema

      public org.olap4j.metadata.Schema getOlapSchema()
      Specified by:
      getOlapSchema in interface org.olap4j.OlapConnection
    • getOlapSchemas

      public org.olap4j.metadata.NamedList<org.olap4j.metadata.Schema> getOlapSchemas() throws org.olap4j.OlapException
      Specified by:
      getOlapSchemas in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • setCatalog

      public void setCatalog(String catalogName)
      Specified by:
      setCatalog in interface Connection
      Specified by:
      setCatalog in interface org.olap4j.OlapConnection
    • getCatalog

      public String getCatalog()
      Specified by:
      getCatalog in interface Connection
      Specified by:
      getCatalog in interface org.olap4j.OlapConnection
    • getOlapCatalog

      public org.olap4j.metadata.Catalog getOlapCatalog()
      Specified by:
      getOlapCatalog in interface org.olap4j.OlapConnection
    • getOlapCatalogs

      public org.olap4j.metadata.NamedList<org.olap4j.metadata.Catalog> getOlapCatalogs() throws org.olap4j.OlapException
      Specified by:
      getOlapCatalogs in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • setDatabase

      public void setDatabase(String databaseName)
      Specified by:
      setDatabase in interface org.olap4j.OlapConnection
    • getDatabase

      public String getDatabase() throws org.olap4j.OlapException
      Specified by:
      getDatabase in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • getOlapDatabase

      public org.olap4j.metadata.Database getOlapDatabase()
      Specified by:
      getOlapDatabase in interface org.olap4j.OlapConnection
    • getOlapDatabases

      public org.olap4j.metadata.NamedList<org.olap4j.metadata.Database> getOlapDatabases()
      Specified by:
      getOlapDatabases in interface org.olap4j.OlapConnection
    • setTransactionIsolation

      public void setTransactionIsolation(int level)
      Specified by:
      setTransactionIsolation in interface Connection
    • getTransactionIsolation

      public int getTransactionIsolation()
      Specified by:
      getTransactionIsolation in interface Connection
    • getWarnings

      public SQLWarning getWarnings()
      Specified by:
      getWarnings in interface Connection
    • clearWarnings

      public void clearWarnings()
      Specified by:
      clearWarnings in interface Connection
    • createStatement

      public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
      Specified by:
      createStatement in interface Connection
      Throws:
      SQLException
    • prepareStatement

      public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
      Specified by:
      prepareStatement in interface Connection
    • prepareCall

      public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
      Specified by:
      prepareCall in interface Connection
    • getTypeMap

      public Map<String,Class<?>> getTypeMap()
      Specified by:
      getTypeMap in interface Connection
    • setTypeMap

      public void setTypeMap(Map<String,Class<?>> map)
      Specified by:
      setTypeMap in interface Connection
    • setHoldability

      public void setHoldability(int holdability)
      Specified by:
      setHoldability in interface Connection
    • getHoldability

      public int getHoldability()
      Specified by:
      getHoldability in interface Connection
    • setSavepoint

      public Savepoint setSavepoint()
      Specified by:
      setSavepoint in interface Connection
    • setSavepoint

      public Savepoint setSavepoint(String name)
      Specified by:
      setSavepoint in interface Connection
    • rollback

      public void rollback(Savepoint savepoint)
      Specified by:
      rollback in interface Connection
    • releaseSavepoint

      public void releaseSavepoint(Savepoint savepoint)
      Specified by:
      releaseSavepoint in interface Connection
    • createStatement

      public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
      Specified by:
      createStatement in interface Connection
      Throws:
      SQLException
    • prepareStatement

      public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      Specified by:
      prepareStatement in interface Connection
    • prepareCall

      public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      Specified by:
      prepareCall in interface Connection
    • prepareStatement

      public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
      Specified by:
      prepareStatement in interface Connection
    • prepareStatement

      public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
      Specified by:
      prepareStatement in interface Connection
    • prepareStatement

      public PreparedStatement prepareStatement(String sql, String[] columnNames)
      Specified by:
      prepareStatement in interface Connection
    • unwrap

      public <T> T unwrap(Class<T> iface) throws SQLException
      Specified by:
      unwrap in interface org.olap4j.OlapWrapper
      Specified by:
      unwrap in interface Wrapper
      Throws:
      SQLException
    • isWrapperFor

      public boolean isWrapperFor(Class<?> iface) throws SQLException
      Specified by:
      isWrapperFor in interface org.olap4j.OlapWrapper
      Specified by:
      isWrapperFor in interface Wrapper
      Throws:
      SQLException
    • prepareOlapStatement

      public org.olap4j.PreparedOlapStatement prepareOlapStatement(String mdx) throws org.olap4j.OlapException
      Specified by:
      prepareOlapStatement in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • getParserFactory

      public org.olap4j.mdx.parser.MdxParserFactory getParserFactory()
      Specified by:
      getParserFactory in interface org.olap4j.OlapConnection
    • setLocale

      public void setLocale(Locale locale)
      Specified by:
      setLocale in interface org.olap4j.OlapConnection
    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface org.olap4j.OlapConnection
    • setRoleName

      public void setRoleName(String roleName) throws org.olap4j.OlapException
      Specified by:
      setRoleName in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • setRoleNames

      public void setRoleNames(List<String> roleNames) throws org.olap4j.OlapException

      Set the active role(s) in this connection based on a list of role names.

      The list may be not be empty. Each role name must be not-null and the name of a valid role for the current user.

      This method is not part of the olap4j-1.x API. It may be included in olap4j-2.0. If you want to call this method on a OlapConnection, use unwrap(java.lang.Class<T>) to get the underlying Mondrian connection.

      Parameters:
      roleNames - List of role names
      Throws:
      org.olap4j.OlapException
      See Also:
    • getRoleName

      public String getRoleName()
      Specified by:
      getRoleName in interface org.olap4j.OlapConnection
    • getRoleNames

      public List<String> getRoleNames()
      Returns a list of the current role names.

      This method is not part of the olap4j-1.x API. It may be included in olap4j-2.0. If you want to call this method on a OlapConnection, use unwrap(java.lang.Class<T>) to get the underlying Mondrian connection.

      Returns:
      List of the current role names
    • getAvailableRoleNames

      public List<String> getAvailableRoleNames() throws org.olap4j.OlapException
      Specified by:
      getAvailableRoleNames in interface org.olap4j.OlapConnection
      Throws:
      org.olap4j.OlapException
    • setPreferList

      public void setPreferList(boolean preferList)
    • getMondrianConnection

      public RolapConnection getMondrianConnection() throws org.olap4j.OlapException
      Throws:
      org.olap4j.OlapException