Class 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 Detail

      • 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
      • getMetaData

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

        public void setSchema​(String schemaName)
                       throws org.olap4j.OlapException
        Specified by:
        setSchema in interface Connection
        Specified by:
        setSchema in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • 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()
                                                 throws org.olap4j.OlapException
        Specified by:
        getOlapSchema in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • 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)
                        throws org.olap4j.OlapException
        Specified by:
        setCatalog in interface Connection
        Specified by:
        setCatalog in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • getCatalog

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

        public org.olap4j.metadata.Catalog getOlapCatalog()
                                                   throws org.olap4j.OlapException
        Specified by:
        getOlapCatalog in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • 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)
                         throws org.olap4j.OlapException
        Specified by:
        setDatabase in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • 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()
                                                     throws org.olap4j.OlapException
        Specified by:
        getOlapDatabase in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • getOlapDatabases

        public org.olap4j.metadata.NamedList<org.olap4j.metadata.Database> getOlapDatabases()
                                                                                     throws org.olap4j.OlapException
        Specified by:
        getOlapDatabases in interface org.olap4j.OlapConnection
        Throws:
        org.olap4j.OlapException
      • 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:
        getRoleNames()
      • 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)