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 ofOlapConnectionfor 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
-
-
Field Summary
-
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearWarnings()voidclose()voidcommit()ScenarioImplcreateScenario()org.olap4j.OlapStatementcreateStatement()StatementcreateStatement(int resultSetType, int resultSetConcurrency)StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)booleangetAutoCommit()List<String>getAvailableRoleNames()StringgetCatalog()StringgetDatabase()intgetHoldability()LocalegetLocale()org.olap4j.OlapDatabaseMetaDatagetMetaData()org.olap4j.metadata.CataloggetOlapCatalog()org.olap4j.metadata.NamedList<org.olap4j.metadata.Catalog>getOlapCatalogs()org.olap4j.metadata.DatabasegetOlapDatabase()org.olap4j.metadata.NamedList<org.olap4j.metadata.Database>getOlapDatabases()org.olap4j.metadata.SchemagetOlapSchema()org.olap4j.metadata.NamedList<org.olap4j.metadata.Schema>getOlapSchemas()org.olap4j.mdx.parser.MdxParserFactorygetParserFactory()StringgetRoleName()List<String>getRoleNames()Returns a list of the current role names.org.olap4j.ScenariogetScenario()StringgetSchema()intgetTransactionIsolation()Map<String,Class<?>>getTypeMap()SQLWarninggetWarnings()booleanisClosed()booleanisReadOnly()booleanisWrapperFor(Class<?> iface)StringnativeSQL(String sql)CallableStatementprepareCall(String sql)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)org.olap4j.PreparedOlapStatementprepareOlapStatement(String mdx)PreparedStatementprepareStatement(String sql)PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)PreparedStatementprepareStatement(String sql, int[] columnIndexes)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql, String[] columnNames)voidreleaseSavepoint(Savepoint savepoint)voidrollback()voidrollback(Savepoint savepoint)voidsetAutoCommit(boolean autoCommit)voidsetCatalog(String catalogName)voidsetDatabase(String databaseName)voidsetHoldability(int holdability)voidsetLocale(Locale locale)voidsetPreferList(boolean preferList)voidsetReadOnly(boolean readOnly)voidsetRoleName(String roleName)voidsetRoleNames(List<String> roleNames)Set the active role(s) in this connection based on a list of role names.SavepointsetSavepoint()SavepointsetSavepoint(String name)voidsetScenario(org.olap4j.Scenario scenario)voidsetSchema(String schemaName)voidsetTransactionIsolation(int level)voidsetTypeMap(Map<String,Class<?>> map)<T> Tunwrap(Class<T> iface)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.Connection
abort, beginRequest, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, endRequest, getClientInfo, getClientInfo, getNetworkTimeout, isValid, setClientInfo, setClientInfo, setNetworkTimeout, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
-
-
-
Method Detail
-
createStatement
public org.olap4j.OlapStatement createStatement()
- Specified by:
createStatementin interfaceConnection- Specified by:
createStatementin interfaceorg.olap4j.OlapConnection
-
createScenario
public ScenarioImpl createScenario() throws org.olap4j.OlapException
- Specified by:
createScenarioin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
setScenario
public void setScenario(org.olap4j.Scenario scenario) throws org.olap4j.OlapException- Specified by:
setScenarioin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getScenario
public org.olap4j.Scenario getScenario() throws org.olap4j.OlapException- Specified by:
getScenarioin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
nativeSQL
public String nativeSQL(String sql) throws SQLException
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws SQLException- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
getAutoCommit
public boolean getAutoCommit() throws SQLException- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
public void commit() throws SQLException- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
rollback
public void rollback() throws SQLException- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
close
public void close() throws SQLException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
getMetaData
public org.olap4j.OlapDatabaseMetaData getMetaData()
- Specified by:
getMetaDatain interfaceConnection- Specified by:
getMetaDatain interfaceorg.olap4j.OlapConnection
-
setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
isReadOnly
public boolean isReadOnly() throws SQLException- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setSchema
public void setSchema(String schemaName) throws org.olap4j.OlapException
- Specified by:
setSchemain interfaceConnection- Specified by:
setSchemain interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getSchema
public String getSchema() throws org.olap4j.OlapException
- Specified by:
getSchemain interfaceConnection- Specified by:
getSchemain interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapSchema
public org.olap4j.metadata.Schema getOlapSchema() throws org.olap4j.OlapException- Specified by:
getOlapSchemain interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapSchemas
public org.olap4j.metadata.NamedList<org.olap4j.metadata.Schema> getOlapSchemas() throws org.olap4j.OlapException- Specified by:
getOlapSchemasin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
setCatalog
public void setCatalog(String catalogName) throws org.olap4j.OlapException
- Specified by:
setCatalogin interfaceConnection- Specified by:
setCatalogin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getCatalog
public String getCatalog() throws org.olap4j.OlapException
- Specified by:
getCatalogin interfaceConnection- Specified by:
getCatalogin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapCatalog
public org.olap4j.metadata.Catalog getOlapCatalog() throws org.olap4j.OlapException- Specified by:
getOlapCatalogin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapCatalogs
public org.olap4j.metadata.NamedList<org.olap4j.metadata.Catalog> getOlapCatalogs() throws org.olap4j.OlapException- Specified by:
getOlapCatalogsin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
setDatabase
public void setDatabase(String databaseName) throws org.olap4j.OlapException
- Specified by:
setDatabasein interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getDatabase
public String getDatabase() throws org.olap4j.OlapException
- Specified by:
getDatabasein interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapDatabase
public org.olap4j.metadata.Database getOlapDatabase() throws org.olap4j.OlapException- Specified by:
getOlapDatabasein interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getOlapDatabases
public org.olap4j.metadata.NamedList<org.olap4j.metadata.Database> getOlapDatabases() throws org.olap4j.OlapException- Specified by:
getOlapDatabasesin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTransactionIsolation
public int getTransactionIsolation() throws SQLException- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
public void clearWarnings() throws SQLException- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
getTypeMap
public Map<String,Class<?>> getTypeMap() throws SQLException
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
setTypeMap
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
setHoldability
public void setHoldability(int holdability) throws SQLException- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
getHoldability
public int getHoldability() throws SQLException- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint() throws SQLException
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint(String name) throws SQLException
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
rollback
public void rollback(Savepoint savepoint) throws SQLException
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
public void releaseSavepoint(Savepoint savepoint) throws SQLException
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrapin interfaceorg.olap4j.OlapWrapper- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperForin interfaceorg.olap4j.OlapWrapper- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
prepareOlapStatement
public org.olap4j.PreparedOlapStatement prepareOlapStatement(String mdx) throws org.olap4j.OlapException
- Specified by:
prepareOlapStatementin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
getParserFactory
public org.olap4j.mdx.parser.MdxParserFactory getParserFactory()
- Specified by:
getParserFactoryin interfaceorg.olap4j.OlapConnection
-
setLocale
public void setLocale(Locale locale)
- Specified by:
setLocalein interfaceorg.olap4j.OlapConnection
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceorg.olap4j.OlapConnection
-
setRoleName
public void setRoleName(String roleName) throws org.olap4j.OlapException
- Specified by:
setRoleNamein interfaceorg.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, useunwrap(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:
getRoleNamein interfaceorg.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, useunwrap(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:
getAvailableRoleNamesin interfaceorg.olap4j.OlapConnection- Throws:
org.olap4j.OlapException
-
setPreferList
public void setPreferList(boolean preferList)
-
-