Type: New Feature
Affects Version/s: None
Fix Version/s: Backlog - Mondrian 4.0
Sometimes the tables needed to power a Mondrian schema live in different databases, and therefore have JDBC connections. This RFE describes how these JDBC connections can be defined and used within a Mondrian schema.
The mechanism could be extended to allow connections to non-JDBC sources, but this feature request does not address this requirement.
This RFE does not describe what Mondrian will do if two tables it needs (e.g. an aggregate table and a dimension table it would like to join to) are in different connections. That will be covered by another RFE.
In Mondrian 3.4, connections are defined using connect string parameters: Jdbc, JdbcUser, JdbcPassword, DataSource. They are not defined in the schema XML file.
In Mondrian 4, connections can be defined in the schema XML file, and can be overridden using connect string parameters. For example,
The 'JdbcPassword' connect string argument overrides the <JdbcPassword> value in the 'default' connection. And the 'JdbcPassword.aggs' connect string argument overrides the <JdbcPassword> element in the
The connection called 'default' is implicitly defined. If you do not define a connection called 'default', Mondrian defines one as if you had written
When you use connect string properties without a qualifying schema name, '.default' is assumed. 'Jdbc=foo' is equivalent to 'Jdbc.default=foo'; similarly JdbcUser, JdbcPassword, DataSource.
It is an error to define properties in the connect string for a connection xxx (e.g. JdbcUser.xxx) if there is no connection xxx defined in the schema. (JdbcUser.default is OK, because 'default' is implicitly defined, and is of course equivalent to JdbcUser.)
The embedded Properties element provides properties to be passed in to the java.sql.DriverManager.getConnection(String, String, String, Properties) method. It is not equivalent to any connect string argument. It is ignored if DataSource is specified.
At most one connection can be labeled 'default=true'. If there are no connections with default=true, Mondrian uses the one called 'default'. You can flag another connection with 'default=true', at possible risk of confusing yourself.
Mondrian uses the default connection for any Table element in PhysicalSchema that does not specify a connection attribute.
For example, in the following, Mondrian will use connection 'default' for table1 and table3, and will use 'agg' connection for table2.
This feature does not affect the 'schema' attribute of the Table element. The schema, if specified, needs to be a valid prefix for table within that JDBC connection.
It is an error if you define a connection in the schema but do not provide enough information to connect, either in the Connection element or using connect-string parameters.
Mondrian may or may not test JDBC connections that are not used. If you provide invalid connection information for an unused connection, behavior is undefined.
Connection names are case sensitive.
For integration with Pentaho server (and other containers) we recommend using "jndi:..." connections. Then you can define them elsewhere.