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 ofOlapConnection
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
-
-
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 void
clearWarnings()
void
close()
void
commit()
ScenarioImpl
createScenario()
org.olap4j.OlapStatement
createStatement()
Statement
createStatement(int resultSetType, int resultSetConcurrency)
Statement
createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
boolean
getAutoCommit()
List<String>
getAvailableRoleNames()
String
getCatalog()
String
getDatabase()
int
getHoldability()
Locale
getLocale()
org.olap4j.OlapDatabaseMetaData
getMetaData()
org.olap4j.metadata.Catalog
getOlapCatalog()
org.olap4j.metadata.NamedList<org.olap4j.metadata.Catalog>
getOlapCatalogs()
org.olap4j.metadata.Database
getOlapDatabase()
org.olap4j.metadata.NamedList<org.olap4j.metadata.Database>
getOlapDatabases()
org.olap4j.metadata.Schema
getOlapSchema()
org.olap4j.metadata.NamedList<org.olap4j.metadata.Schema>
getOlapSchemas()
org.olap4j.mdx.parser.MdxParserFactory
getParserFactory()
String
getRoleName()
List<String>
getRoleNames()
Returns a list of the current role names.org.olap4j.Scenario
getScenario()
String
getSchema()
int
getTransactionIsolation()
Map<String,Class<?>>
getTypeMap()
SQLWarning
getWarnings()
boolean
isClosed()
boolean
isReadOnly()
boolean
isWrapperFor(Class<?> iface)
String
nativeSQL(String sql)
CallableStatement
prepareCall(String sql)
CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency)
CallableStatement
prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
org.olap4j.PreparedOlapStatement
prepareOlapStatement(String mdx)
PreparedStatement
prepareStatement(String sql)
PreparedStatement
prepareStatement(String sql, int autoGeneratedKeys)
PreparedStatement
prepareStatement(String sql, int[] columnIndexes)
PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
PreparedStatement
prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
PreparedStatement
prepareStatement(String sql, String[] columnNames)
void
releaseSavepoint(Savepoint savepoint)
void
rollback()
void
rollback(Savepoint savepoint)
void
setAutoCommit(boolean autoCommit)
void
setCatalog(String catalogName)
void
setDatabase(String databaseName)
void
setHoldability(int holdability)
void
setLocale(Locale locale)
void
setPreferList(boolean preferList)
void
setReadOnly(boolean readOnly)
void
setRoleName(String roleName)
void
setRoleNames(List<String> roleNames)
Set the active role(s) in this connection based on a list of role names.Savepoint
setSavepoint()
Savepoint
setSavepoint(String name)
void
setScenario(org.olap4j.Scenario scenario)
void
setSchema(String schemaName)
void
setTransactionIsolation(int level)
void
setTypeMap(Map<String,Class<?>> map)
<T> T
unwrap(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:
createStatement
in interfaceConnection
- Specified by:
createStatement
in interfaceorg.olap4j.OlapConnection
-
createScenario
public ScenarioImpl createScenario() throws org.olap4j.OlapException
- Specified by:
createScenario
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setScenario
public void setScenario(org.olap4j.Scenario scenario) throws org.olap4j.OlapException
- Specified by:
setScenario
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getScenario
public org.olap4j.Scenario getScenario() throws org.olap4j.OlapException
- Specified by:
getScenario
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql) throws SQLException
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
nativeSQL
public String nativeSQL(String sql) throws SQLException
- Specified by:
nativeSQL
in interfaceConnection
- Throws:
SQLException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws SQLException
- Specified by:
setAutoCommit
in interfaceConnection
- Throws:
SQLException
-
getAutoCommit
public boolean getAutoCommit() throws SQLException
- Specified by:
getAutoCommit
in interfaceConnection
- Throws:
SQLException
-
commit
public void commit() throws SQLException
- Specified by:
commit
in interfaceConnection
- Throws:
SQLException
-
rollback
public void rollback() throws SQLException
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException
- Specified by:
isClosed
in interfaceConnection
- Throws:
SQLException
-
getMetaData
public org.olap4j.OlapDatabaseMetaData getMetaData()
- Specified by:
getMetaData
in interfaceConnection
- Specified by:
getMetaData
in interfaceorg.olap4j.OlapConnection
-
setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException
- Specified by:
setReadOnly
in interfaceConnection
- Throws:
SQLException
-
isReadOnly
public boolean isReadOnly() throws SQLException
- Specified by:
isReadOnly
in interfaceConnection
- Throws:
SQLException
-
setSchema
public void setSchema(String schemaName) throws org.olap4j.OlapException
- Specified by:
setSchema
in interfaceConnection
- Specified by:
setSchema
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getSchema
public String getSchema() throws org.olap4j.OlapException
- Specified by:
getSchema
in interfaceConnection
- Specified by:
getSchema
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getOlapSchema
public org.olap4j.metadata.Schema getOlapSchema() throws org.olap4j.OlapException
- Specified by:
getOlapSchema
in interfaceorg.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 interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setCatalog
public void setCatalog(String catalogName) throws org.olap4j.OlapException
- Specified by:
setCatalog
in interfaceConnection
- Specified by:
setCatalog
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getCatalog
public String getCatalog() throws org.olap4j.OlapException
- Specified by:
getCatalog
in interfaceConnection
- Specified by:
getCatalog
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getOlapCatalog
public org.olap4j.metadata.Catalog getOlapCatalog() throws org.olap4j.OlapException
- Specified by:
getOlapCatalog
in interfaceorg.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 interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setDatabase
public void setDatabase(String databaseName) throws org.olap4j.OlapException
- Specified by:
setDatabase
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getDatabase
public String getDatabase() throws org.olap4j.OlapException
- Specified by:
getDatabase
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getOlapDatabase
public org.olap4j.metadata.Database getOlapDatabase() throws org.olap4j.OlapException
- Specified by:
getOlapDatabase
in interfaceorg.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 interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException
- Specified by:
setTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
getTransactionIsolation
public int getTransactionIsolation() throws SQLException
- Specified by:
getTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- Specified by:
getWarnings
in interfaceConnection
- Throws:
SQLException
-
clearWarnings
public void clearWarnings() throws SQLException
- Specified by:
clearWarnings
in interfaceConnection
- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
getTypeMap
public Map<String,Class<?>> getTypeMap() throws SQLException
- Specified by:
getTypeMap
in interfaceConnection
- Throws:
SQLException
-
setTypeMap
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
- Specified by:
setTypeMap
in interfaceConnection
- Throws:
SQLException
-
setHoldability
public void setHoldability(int holdability) throws SQLException
- Specified by:
setHoldability
in interfaceConnection
- Throws:
SQLException
-
getHoldability
public int getHoldability() throws SQLException
- Specified by:
getHoldability
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint() throws SQLException
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint(String name) throws SQLException
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
rollback
public void rollback(Savepoint savepoint) throws SQLException
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
releaseSavepoint
public void releaseSavepoint(Savepoint savepoint) throws SQLException
- Specified by:
releaseSavepoint
in interfaceConnection
- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrap
in interfaceorg.olap4j.OlapWrapper
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
- Specified by:
isWrapperFor
in interfaceorg.olap4j.OlapWrapper
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
prepareOlapStatement
public org.olap4j.PreparedOlapStatement prepareOlapStatement(String mdx) throws org.olap4j.OlapException
- Specified by:
prepareOlapStatement
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getParserFactory
public org.olap4j.mdx.parser.MdxParserFactory getParserFactory()
- Specified by:
getParserFactory
in interfaceorg.olap4j.OlapConnection
-
setLocale
public void setLocale(Locale locale)
- Specified by:
setLocale
in interfaceorg.olap4j.OlapConnection
-
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceorg.olap4j.OlapConnection
-
setRoleName
public void setRoleName(String roleName) throws org.olap4j.OlapException
- Specified by:
setRoleName
in 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:
getRoleName
in 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:
getAvailableRoleNames
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setPreferList
public void setPreferList(boolean preferList)
-
-