Class MondrianOlap4jConnection
- All Implemented Interfaces:
AutoCloseable
,Connection
,Wrapper
,org.olap4j.OlapConnection
,org.olap4j.OlapWrapper
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
-
Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
void
commit()
org.olap4j.OlapStatement
createStatement
(int resultSetType, int resultSetConcurrency) createStatement
(int resultSetType, int resultSetConcurrency, int resultSetHoldability) boolean
int
org.olap4j.OlapDatabaseMetaData
org.olap4j.metadata.Catalog
org.olap4j.metadata.NamedList<org.olap4j.metadata.Catalog>
org.olap4j.metadata.Database
org.olap4j.metadata.NamedList<org.olap4j.metadata.Database>
org.olap4j.metadata.Schema
org.olap4j.metadata.NamedList<org.olap4j.metadata.Schema>
org.olap4j.mdx.parser.MdxParserFactory
Returns a list of the current role names.org.olap4j.Scenario
int
boolean
isClosed()
boolean
boolean
isWrapperFor
(Class<?> iface) prepareCall
(String sql) prepareCall
(String sql, int resultSetType, int resultSetConcurrency) prepareCall
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) org.olap4j.PreparedOlapStatement
prepareStatement
(String sql) prepareStatement
(String sql, int autoGeneratedKeys) prepareStatement
(String sql, int[] columnIndexes) prepareStatement
(String sql, int resultSetType, int resultSetConcurrency) prepareStatement
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement
(String sql, String[] columnNames) void
releaseSavepoint
(Savepoint savepoint) void
rollback()
void
void
setAutoCommit
(boolean autoCommit) void
setCatalog
(String catalogName) void
setDatabase
(String databaseName) void
setHoldability
(int holdability) void
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.setSavepoint
(String name) void
setScenario
(org.olap4j.Scenario scenario) void
void
setTransactionIsolation
(int level) void
setTypeMap
(Map<String, Class<?>> map) <T> T
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 Details
-
createStatement
public org.olap4j.OlapStatement createStatement()- Specified by:
createStatement
in interfaceConnection
- Specified by:
createStatement
in interfaceorg.olap4j.OlapConnection
-
createScenario
- 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
- Specified by:
prepareStatement
in interfaceConnection
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
-
nativeSQL
- Specified by:
nativeSQL
in interfaceConnection
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) - Specified by:
setAutoCommit
in interfaceConnection
-
getAutoCommit
public boolean getAutoCommit()- Specified by:
getAutoCommit
in interfaceConnection
-
commit
public void commit()- Specified by:
commit
in interfaceConnection
-
rollback
public void rollback()- Specified by:
rollback
in interfaceConnection
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Throws:
SQLException
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceConnection
-
getMetaData
public org.olap4j.OlapDatabaseMetaData getMetaData()- Specified by:
getMetaData
in interfaceConnection
- Specified by:
getMetaData
in interfaceorg.olap4j.OlapConnection
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnly
in interfaceConnection
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceConnection
-
setSchema
- Specified by:
setSchema
in interfaceConnection
- Specified by:
setSchema
in interfaceorg.olap4j.OlapConnection
-
getSchema
- Specified by:
getSchema
in interfaceConnection
- Specified by:
getSchema
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getOlapSchema
public org.olap4j.metadata.Schema getOlapSchema()- Specified by:
getOlapSchema
in interfaceorg.olap4j.OlapConnection
-
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
- Specified by:
setCatalog
in interfaceConnection
- Specified by:
setCatalog
in interfaceorg.olap4j.OlapConnection
-
getCatalog
- Specified by:
getCatalog
in interfaceConnection
- Specified by:
getCatalog
in interfaceorg.olap4j.OlapConnection
-
getOlapCatalog
public org.olap4j.metadata.Catalog getOlapCatalog()- Specified by:
getOlapCatalog
in interfaceorg.olap4j.OlapConnection
-
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
- Specified by:
setDatabase
in interfaceorg.olap4j.OlapConnection
-
getDatabase
- Specified by:
getDatabase
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
getOlapDatabase
public org.olap4j.metadata.Database getOlapDatabase()- Specified by:
getOlapDatabase
in interfaceorg.olap4j.OlapConnection
-
getOlapDatabases
public org.olap4j.metadata.NamedList<org.olap4j.metadata.Database> getOlapDatabases()- Specified by:
getOlapDatabases
in interfaceorg.olap4j.OlapConnection
-
setTransactionIsolation
public void setTransactionIsolation(int level) - Specified by:
setTransactionIsolation
in interfaceConnection
-
getTransactionIsolation
public int getTransactionIsolation()- Specified by:
getTransactionIsolation
in interfaceConnection
-
getWarnings
- Specified by:
getWarnings
in interfaceConnection
-
clearWarnings
public void clearWarnings()- Specified by:
clearWarnings
in interfaceConnection
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
-
getTypeMap
- Specified by:
getTypeMap
in interfaceConnection
-
setTypeMap
- Specified by:
setTypeMap
in interfaceConnection
-
setHoldability
public void setHoldability(int holdability) - Specified by:
setHoldability
in interfaceConnection
-
getHoldability
public int getHoldability()- Specified by:
getHoldability
in interfaceConnection
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
-
rollback
- Specified by:
rollback
in interfaceConnection
-
releaseSavepoint
- Specified by:
releaseSavepoint
in interfaceConnection
-
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) - Specified by:
prepareStatement
in interfaceConnection
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) - Specified by:
prepareCall
in interfaceConnection
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
-
unwrap
- Specified by:
unwrap
in interfaceorg.olap4j.OlapWrapper
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- 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
- Specified by:
setLocale
in interfaceorg.olap4j.OlapConnection
-
getLocale
- Specified by:
getLocale
in interfaceorg.olap4j.OlapConnection
-
setRoleName
- Specified by:
setRoleName
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setRoleNames
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:
-
getRoleName
- Specified by:
getRoleName
in interfaceorg.olap4j.OlapConnection
-
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
- Specified by:
getAvailableRoleNames
in interfaceorg.olap4j.OlapConnection
- Throws:
org.olap4j.OlapException
-
setPreferList
public void setPreferList(boolean preferList) -
getMondrianConnection
- Throws:
org.olap4j.OlapException
-