Package mondrian.rolap
Class RolapConnection
java.lang.Object
mondrian.olap.ConnectionBase
mondrian.rolap.RolapConnection
- All Implemented Interfaces:
Connection
A
RolapConnection
is a connection to a Mondrian OLAP Server.
Typically, you create a connection via
DriverManager.getConnection(String, mondrian.spi.CatalogLocator)
.
RolapConnectionProperties
describes allowable keywords.
- Since:
- 2 October, 2002
- Author:
- jhyde
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRolapConnection
(MondrianServer server, Util.PropertyList connectInfo, DataSource dataSource) Creates a connection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes thisConnection
.Helper method to allow olap4j wrappers to implementOlapConnection.createScenario()
.Deprecated.Executes a statement.protected void
finalize()
Returns an object with which to explicitly control the contents of the cache.Get the name of the Catalog associated with this Connection.Get the Connect String associated with this Connection.Returns the data source this connection uses to create connections to the underlying JDBC database.int
getId()
Returns the identifier of this connection.Returns the locale this connection belongs to.protected org.apache.logging.log4j.Logger
getProperty
(String name) Returns the value of a connection property.getRole()
Returns the access-control profile for this connection.org.olap4j.Scenario
Get the Schema associated with this Connection.Returns a schema reader with access control appropriate to the current role.Returns the server (mondrian instance) that this connection belongs to.parseExpression
(String expr) Parses an expresion.parseStatement
(String query) Parses a statement.void
void
Sets the privileges for the this connection.void
setScenario
(org.olap4j.Scenario scenario) Methods inherited from class mondrian.olap.ConnectionBase
createParser, getFullConnectString, parseQuery, parseStatement
-
Field Details
-
role
-
-
Constructor Details
-
RolapConnection
Creates a connection.- Parameters:
server
- Server instance this connection belongs toconnectInfo
- Connection properties; keywords are described inRolapConnectionProperties
.dataSource
- JDBC data source
-
-
Method Details
-
finalize
-
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:
getLogger
in classConnectionBase
-
getConnectInfo
-
close
public void close()Description copied from interface:Connection
Closes thisConnection
. You may not use thisConnection
after closing it. -
getSchema
Description copied from interface:Connection
Get the Schema associated with this Connection.- Returns:
- the Schema (never null).
-
getConnectString
Description copied from interface:Connection
Get the Connect String associated with this Connection.- Returns:
- the Connect String (never null).
-
getCatalogName
Description copied from interface:Connection
Get the name of the Catalog associated with this Connection.- Returns:
- the Catalog name (never null).
-
getLocale
Description copied from interface:Connection
Returns the locale this connection belongs to. Determines, for example, the currency string used in formatting cell values.- See Also:
-
setLocale
-
getSchemaReader
Description copied from interface:Connection
Returns a schema reader with access control appropriate to the current role. -
getProperty
Description copied from interface:Connection
Returns 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
Description copied from interface:Connection
Returns 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
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
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
Description copied from interface:Connection
Sets the privileges for the this connection. -
getRole
Description copied from interface:Connection
Returns the access-control profile for this connection. -
setScenario
public void setScenario(org.olap4j.Scenario scenario) -
getScenario
public org.olap4j.Scenario getScenario() -
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
Description copied from interface:Connection
Parses a statement.- Parameters:
query
- MDX string- Returns:
- A
Query
if it is a SELECT statement, aDrillThrough
if it is a DRILLTHROUGH statement
-
parseExpression
Description copied from interface:Connection
Parses an expresion. -
getInternalStatement
- Specified by:
getInternalStatement
in classConnectionBase
-
getDataSource
Description copied from interface:Connection
Returns the data source this connection uses to create connections to the underlying JDBC database.- Returns:
- Data source
-
createScenario
Helper method to allow olap4j wrappers to implementOlapConnection.createScenario()
.- Returns:
- new Scenario
-
execute(mondrian.server.Execution)
; this method will be removed in mondrian-4.0