|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.olap4j.MondrianOlap4jDriver
mondrian.olap4j.MondrianOlap4jEngineDriver
public class MondrianOlap4jEngineDriver
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).
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.

| 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()
| Method Detail |
|---|
String getName()
MondrianOlap4jDriver
getName in class MondrianOlap4jDriver
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||