mondrian.olap4j
Class MondrianOlap4jEngineDriver

java.lang.Object
  extended by mondrian.olap4j.MondrianOlap4jDriver
      extended by mondrian.olap4j.MondrianOlap4jEngineDriver
All Implemented Interfaces:
Driver

public class MondrianOlap4jEngineDriver
extends MondrianOlap4jDriver

Olap4j driver for Mondrian that behaves as a server.

Unlike the client driver MondrianOlap4jDriver, this driver knows the list of schemas and catalogs, by parsing datasources.xml.

Since olap4j is a superset of JDBC, you register this driver as you would any JDBC driver:

Class.forName("mondrian.olap4j.MondrianOlap4jEngineDriver");

Then create a connection using a URL with the prefix "jdbc:mondrian:engine:". For example,

import java.sql.Connection;
import java.sql.DriverManager;
import org.olap4j.OlapConnection;

Connection connection =
  DriverManager.getConnection(
    "jdbc:mondrian:engine:Schema=FoodMart");
OlapConnection olapConnection =
  connection.unwrap(OlapConnection.class);

Note how we use the java.sql.Connection#unwrap(Class) method to down-cast the JDBC connection object to the extension OlapConnection object. This method is only available in the JDBC 4.0 (JDK 1.6 onwards).

Connection properties

The driver supports the same set of properties as a traditional mondrian connection. See RolapConnectionProperties. Properties that allow the client to make connections to arbitrary databases ("Jdbc", "JdbcUser", "JdbcPassword", "Catalog") may be disabled.

Since:
Nov 12, 2010
Author:
jhyde
 

Field Summary
 
Fields inherited from class mondrian.olap4j.MondrianOlap4jDriver
factory
 
Constructor Summary
MondrianOlap4jEngineDriver()
          Creates a MondrianOlap4jEngineDriver.
 
Method Summary
(package private)  String getName()
          Returns the driver name.
 
Methods inherited from class mondrian.olap4j.MondrianOlap4jDriver
acceptsURL, connect, getMajorVersion, getMinorVersion, getPropertyInfo, getVersion, jdbcCompliant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MondrianOlap4jEngineDriver

MondrianOlap4jEngineDriver()
Creates a MondrianOlap4jEngineDriver.

Method Detail

getName

String getName()
Description copied from class: MondrianOlap4jDriver
Returns the driver name. Not in the JDBC API.

Overrides:
getName in class MondrianOlap4jDriver
Returns:
Driver name

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads