public abstract class MondrianOlap4jConnection extends Object implements OlapConnection
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.
| Modifier and Type | Class and Description | 
|---|---|
(package private) static class  | 
MondrianOlap4jConnection.Helper
Package-private helper class which encapsulates policies which are
 common throughout the driver. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
(package private) MondrianOlap4jDriver | 
driver  | 
(package private) Factory | 
factory  | 
(package private) MondrianOlap4jConnection.Helper | 
helper
Handler for errors. 
 | 
(package private) MondrianServer | 
mondrianServer  | 
(package private) boolean | 
preferList  | 
(package private) Map<Schema,MondrianOlap4jSchema> | 
schemaMap
Map from mondrian schema objects to olap4j schemas. 
 | 
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description | 
|---|
MondrianOlap4jConnection(Factory factory,
                        MondrianOlap4jDriver driver,
                        String url,
                        Properties info)
Creates an Olap4j connection to Mondrian. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitabort, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getNetworkTimeout, isValid, setClientInfo, setClientInfo, setNetworkTimeoutfinal MondrianOlap4jConnection.Helper helper
final Map<Schema,MondrianOlap4jSchema> schemaMap
REVIEW: This assumes that a RolapSchema occurs at most once in a catalog. It is possible for a schema to be mapped more than once, with different names; the same RolapSchema object will be used.
final Factory factory
final MondrianOlap4jDriver driver
boolean preferList
final MondrianServer mondrianServer
MondrianOlap4jConnection(Factory factory, MondrianOlap4jDriver driver, String url, Properties info) throws SQLException
This method is intentionally package-protected. The public API
 uses the traditional JDBC DriverManager.
 See MondrianOlap4jDriver for more details.
factory - Factorydriver - Driverurl - Connect-string URLinfo - Additional propertiesSQLException - if there is an errorstatic boolean acceptsURL(String url)
public OlapStatement createStatement()
createStatement in interface ConnectioncreateStatement in interface OlapConnectionpublic ScenarioImpl createScenario() throws OlapException
createScenario in interface OlapConnectionOlapExceptionpublic void setScenario(Scenario scenario) throws OlapException
setScenario in interface OlapConnectionOlapExceptionpublic Scenario getScenario() throws OlapException
getScenario in interface OlapConnectionOlapExceptionpublic PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic String nativeSQL(String sql) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic void setAutoCommit(boolean autoCommit)
                   throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic boolean getAutoCommit()
                      throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic void commit()
            throws SQLException
commit in interface ConnectionSQLExceptionpublic void rollback()
              throws SQLException
rollback in interface ConnectionSQLExceptionpublic void close()
           throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionpublic boolean isClosed()
                 throws SQLException
isClosed in interface ConnectionSQLExceptionpublic OlapDatabaseMetaData getMetaData()
getMetaData in interface ConnectiongetMetaData in interface OlapConnectionpublic void setReadOnly(boolean readOnly)
                 throws SQLException
setReadOnly in interface ConnectionSQLExceptionpublic boolean isReadOnly()
                   throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic void setSchema(String schemaName) throws OlapException
setSchema in interface ConnectionsetSchema in interface OlapConnectionOlapExceptionpublic String getSchema() throws OlapException
getSchema in interface ConnectiongetSchema in interface OlapConnectionOlapExceptionpublic Schema getOlapSchema() throws OlapException
getOlapSchema in interface OlapConnectionOlapExceptionpublic NamedList<Schema> getOlapSchemas() throws OlapException
getOlapSchemas in interface OlapConnectionOlapExceptionpublic void setCatalog(String catalogName) throws OlapException
setCatalog in interface ConnectionsetCatalog in interface OlapConnectionOlapExceptionpublic String getCatalog() throws OlapException
getCatalog in interface ConnectiongetCatalog in interface OlapConnectionOlapExceptionpublic Catalog getOlapCatalog() throws OlapException
getOlapCatalog in interface OlapConnectionOlapExceptionpublic NamedList<Catalog> getOlapCatalogs() throws OlapException
getOlapCatalogs in interface OlapConnectionOlapExceptionpublic void setDatabase(String databaseName) throws OlapException
setDatabase in interface OlapConnectionOlapExceptionpublic String getDatabase() throws OlapException
getDatabase in interface OlapConnectionOlapExceptionpublic Database getOlapDatabase() throws OlapException
getOlapDatabase in interface OlapConnectionOlapExceptionpublic NamedList<Database> getOlapDatabases() throws OlapException
getOlapDatabases in interface OlapConnectionOlapExceptionpublic void setTransactionIsolation(int level)
                             throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionpublic int getTransactionIsolation()
                            throws SQLException
getTransactionIsolation in interface ConnectionSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface ConnectionSQLExceptionpublic void clearWarnings()
                   throws SQLException
clearWarnings in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic Map<String,Class<?>> getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic void setHoldability(int holdability)
                    throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic int getHoldability()
                   throws SQLException
getHoldability in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic void rollback(Savepoint savepoint) throws SQLException
rollback in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface Wrapperunwrap in interface OlapWrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperisWrapperFor in interface OlapWrapperSQLExceptionpublic PreparedOlapStatement prepareOlapStatement(String mdx) throws OlapException
prepareOlapStatement in interface OlapConnectionOlapExceptionpublic MdxParserFactory getParserFactory()
getParserFactory in interface OlapConnectionMondrianOlap4jCube toOlap4j(Cube cube)
MondrianOlap4jDimension toOlap4j(Dimension dimension)
MondrianOlap4jSchema toOlap4j(Schema schema)
MondrianOlap4jMember toOlap4j(Member member)
MondrianOlap4jLevel toOlap4j(Level level)
MondrianOlap4jHierarchy toOlap4j(Hierarchy hierarchy)
NamedList<MondrianOlap4jMember> toOlap4j(List<Member> memberList)
MondrianOlap4jNamedSet toOlap4j(Cube cube, NamedSet namedSet)
ParseTreeNode toOlap4j(Exp exp)
SelectNode toOlap4j(Query query)
public void setLocale(Locale locale)
setLocale in interface OlapConnectionpublic Locale getLocale()
getLocale in interface OlapConnectionpublic void setRoleName(String roleName) throws OlapException
setRoleName in interface OlapConnectionOlapExceptionpublic void setRoleNames(List<String> roleNames) throws 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.
roleNames - List of role namesOlapExceptiongetRoleNames()public String getRoleName()
getRoleName in interface OlapConnectionpublic List<String> getRoleNames()
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.
public List<String> getAvailableRoleNames() throws OlapException
getAvailableRoleNames in interface OlapConnectionOlapExceptionpublic void setPreferList(boolean preferList)
RolapConnection getMondrianConnection2() throws RuntimeException
getMondrianConnection() that doesn't throw
 a checked exception. For those situations where the olap4j API doesn't
 declare 'throws OlapException', but we need an open connection anyway.
 Use getMondrianConnection() where possible.RuntimeException - if connection is closedRolapConnection getMondrianConnection() throws OlapException
OlapException