Package mondrian.rolap
Class RolapConnection
- java.lang.Object
-
- mondrian.olap.ConnectionBase
-
- mondrian.rolap.RolapConnection
-
- All Implemented Interfaces:
Connection
public class RolapConnection extends ConnectionBase
ARolapConnectionis a connection to a Mondrian OLAP Server.Typically, you create a connection via
DriverManager.getConnection(String, mondrian.spi.CatalogLocator).RolapConnectionPropertiesdescribes allowable keywords.- Since:
- 2 October, 2002
- Author:
- jhyde
- See Also:
RolapSchema,DriverManager
-
-
Constructor Summary
Constructors Constructor Description RolapConnection(MondrianServer server, Util.PropertyList connectInfo, DataSource dataSource)Creates a connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Closes thisConnection.ScenarioImplcreateScenario()Helper method to allow olap4j wrappers to implementOlapConnection.createScenario().Resultexecute(Query query)Deprecated.Useexecute(mondrian.server.Execution); this method will be removed in mondrian-4.0Resultexecute(Execution execution)Executes a statement.protected voidfinalize()CacheControlgetCacheControl(PrintWriter pw)Returns an object with which to explicitly control the contents of the cache.StringgetCatalogName()Get the name of the Catalog associated with this Connection.Util.PropertyListgetConnectInfo()StringgetConnectString()Get the Connect String associated with this Connection.DataSourcegetDataSource()Returns the data source this connection uses to create connections to the underlying JDBC database.intgetId()Returns the identifier of this connection.StatementgetInternalStatement()LocalegetLocale()Returns the locale this connection belongs to.protected org.apache.logging.log4j.LoggergetLogger()ObjectgetProperty(String name)Returns the value of a connection property.RolegetRole()Returns the access-control profile for this connection.org.olap4j.ScenariogetScenario()RolapSchemagetSchema()Get the Schema associated with this Connection.SchemaReadergetSchemaReader()Returns a schema reader with access control appropriate to the current role.MondrianServergetServer()Returns the server (mondrian instance) that this connection belongs to.ExpparseExpression(String expr)Parses an expresion.QueryPartparseStatement(String query)Parses a statement.voidsetLocale(Locale locale)voidsetRole(Role role)Sets the privileges for the this connection.voidsetScenario(org.olap4j.Scenario scenario)-
Methods inherited from class mondrian.olap.ConnectionBase
createParser, getFullConnectString, parseQuery, parseStatement
-
-
-
-
Field Detail
-
role
protected Role role
-
-
Constructor Detail
-
RolapConnection
public RolapConnection(MondrianServer server, Util.PropertyList connectInfo, DataSource dataSource)
Creates a connection.- Parameters:
server- Server instance this connection belongs toconnectInfo- Connection properties; keywords are described inRolapConnectionProperties.dataSource- JDBC data source
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
getId
public int getId()
Returns the identifier of this connection. Unique within the lifetime of this JVM.- Returns:
- Identifier of this connection
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()
- Specified by:
getLoggerin classConnectionBase
-
getConnectInfo
public Util.PropertyList getConnectInfo()
-
close
public void close()
Description copied from interface:ConnectionCloses thisConnection. You may not use thisConnectionafter closing it.
-
getSchema
public RolapSchema getSchema()
Description copied from interface:ConnectionGet the Schema associated with this Connection.- Returns:
- the Schema (never null).
-
getConnectString
public String getConnectString()
Description copied from interface:ConnectionGet the Connect String associated with this Connection.- Returns:
- the Connect String (never null).
-
getCatalogName
public String getCatalogName()
Description copied from interface:ConnectionGet the name of the Catalog associated with this Connection.- Returns:
- the Catalog name (never null).
-
getLocale
public Locale getLocale()
Description copied from interface:ConnectionReturns the locale this connection belongs to. Determines, for example, the currency string used in formatting cell values.- See Also:
Format
-
setLocale
public void setLocale(Locale locale)
-
getSchemaReader
public SchemaReader getSchemaReader()
Description copied from interface:ConnectionReturns a schema reader with access control appropriate to the current role.
-
getProperty
public Object getProperty(String name)
Description copied from interface:ConnectionReturns the value of a connection property.- Parameters:
name- Name of property, for example "JdbcUser".- Returns:
- Value of property, or null if property is not defined.
-
getCacheControl
public CacheControl getCacheControl(PrintWriter pw)
Description copied from interface:ConnectionReturns an object with which to explicitly control the contents of the cache.- Parameters:
pw- Writer to which to write logging information; may be null
-
execute
public Result execute(Query query)
Deprecated.Useexecute(mondrian.server.Execution); this method will be removed in mondrian-4.0Executes a Query.- Parameters:
query- Query parse tree- Throws:
ResourceLimitExceededException- if some resource limit specified in the property file was exceededQueryCanceledException- if query was canceled during executionQueryTimeoutException- if query exceeded timeout specified in the property file
-
execute
public Result execute(Execution execution)
Executes a statement.- Parameters:
execution- Execution context (includes statement, query)- Throws:
ResourceLimitExceededException- if some resource limit specified in the property file was exceededQueryCanceledException- if query was canceled during executionQueryTimeoutException- if query exceeded timeout specified in the property file
-
setRole
public void setRole(Role role)
Description copied from interface:ConnectionSets the privileges for the this connection.
-
getRole
public Role getRole()
Description copied from interface:ConnectionReturns the access-control profile for this connection.
-
setScenario
public void setScenario(org.olap4j.Scenario scenario)
-
getScenario
public org.olap4j.Scenario getScenario()
-
getServer
public MondrianServer getServer()
Returns the server (mondrian instance) that this connection belongs to. Usually there is only one server instance in a given JVM.- Returns:
- Server instance; never null
-
parseStatement
public QueryPart parseStatement(String query)
Description copied from interface:ConnectionParses a statement.- Parameters:
query- MDX string- Returns:
- A
Queryif it is a SELECT statement, aDrillThroughif it is a DRILLTHROUGH statement
-
parseExpression
public Exp parseExpression(String expr)
Description copied from interface:ConnectionParses an expresion.
-
getInternalStatement
public Statement getInternalStatement()
- Specified by:
getInternalStatementin classConnectionBase
-
getDataSource
public DataSource getDataSource()
Description copied from interface:ConnectionReturns the data source this connection uses to create connections to the underlying JDBC database.- Returns:
- Data source
-
createScenario
public ScenarioImpl createScenario()
Helper method to allow olap4j wrappers to implementOlapConnection.createScenario().- Returns:
- new Scenario
-
-