Skip to content
Open Java API for OLAP
Java Awk Other
Find file
Failed to load latest commit information.
.settings Sets Eclipse JRE setting to an execution environment value rather tha… Apr 7, 2010
doc Preparation of the 1.2.0 release. Commiting these changes so we have … Feb 13, 2014
foodmart Adds Profit last Period to Warehouse and Sales. Dec 17, 2012
src In query builder, add hierarchizeMode to axis Apr 7, 2016
testsrc/org/olap4j [OLAP4J-46] TCK should expect "Has coffee bar" property to be BOOLEAN… Apr 25, 2016
xmla-cache Changes the database xmla cache to save entries as XML rather than a … Mar 22, 2011
.classpath Removes some libraries from the binary distro. Updates the Eclipse cl… Jan 16, 2013
.gitignore initial maven prototype Apr 4, 2016
.project Eclipse JDK 1.5 and build path settings Sep 2, 2006
.travis.yml Enable oraclejdk8 in Travis CI. Dec 16, 2013
HISTORY.md Preparation of the 1.2.0 release. Commiting these changes so we have … Feb 13, 2014
KEYS Add KEYS Mar 25, 2016
LICENSE Apache Software License, version 2.0. Jan 5, 2012
NOTICE Apache Software License, version 2.0. Jan 5, 2012
README.md Update travis link in README. Aug 8, 2013
README.txt Some work to get ready for the 1.1.0 release. Also fixes a problem wi… Jan 14, 2013
RELEASE_CHECKLIST.txt Add KEYS Mar 25, 2016
build.properties Updates the new builds so they produce TRUNK-SNAPSHOT binaries Feb 14, 2014
build.xml Small tweak to the build file. Target source.jar must be called in 'a… Feb 13, 2014
checkFile.awk Improve javadoc for XMLA constants. Nov 29, 2012
checkFile.sh Remove '$Id' tags; they are useless under git. Nov 29, 2012
ivy-jdk14.xml Remove '$Id' tags; they are useless under git. Nov 29, 2012
ivy-tck.xml Remove '$Id' tags; they are useless under git. Nov 29, 2012
ivy-xmla.xml Remove '$Id' tags; they are useless under git. Nov 29, 2012
ivy.xml Removes the Java RTs from the runtime dependencies. Dec 17, 2012
ivysettings.xml initial maven prototype Apr 4, 2016
olap4j_version_2_specification.md Add goal to remove XmlaExtra. Jun 3, 2013
pom.xml Organize maven dependencies Apr 4, 2016
subfloor.xml Remove '$Id' tags; they are useless under git. Nov 29, 2012
test.properties Remove '$Id' tags; they are useless under git. Nov 29, 2012

README.md

Build Status

olap4j

Olap4j is an open Java API for accessing OLAP data.

It is an extension to JDBC. For example, its OlapConnection class extends java.sql.Connection, from which you can create an OlapStatement, and execute to create a CellSet (analogous to a java.sql.ResultSet). There are also similar mechanisms for browsing metadata. As a result, olap4j is easy to learn if you have JDBC experience and know a little about OLAP.

Prerequisites

Olap4j requires ant (version 1.7 or later) and JDK 1.7 to build. (Once built, it also runs under JDK 1.5 and 1.6.)

Download and build

$ git clone git://github.com/olap4j/olap4j.git
$ cd olap4j
$ ant

Writing a simple program

You can now write and run a simple program against olap4j. For example, you can write:

import org.olap4j.*;
import org.olap4j.metadata.Member;
import java.sql.*;

Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
Connection connection =
    DriverManager.getConnection(
        "jdbc:xmla:Server=http://example.com:8080/mondrian/xmla");
OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
OlapStatement statement = olapConnection.createStatement();
CellSet cellSet =
    statement.executeOlapQuery(
        "SELECT {[Measures].[Unit Sales]} ON 0,\n"
        + "{[Product].Children} ON 1\n"
        + "FROM [Sales]");
for (Position row : cellSet.getAxes().get(1)) {
    for (Position column : cellSet.getAxes().get(0)) {
        for (Member member : row.getMembers()) {
            System.out.println(member.getUniqueName());
        }
        for (Member member : column.getMembers()) {
            System.out.println(member.getUniqueName());
        }
        final Cell cell = cellSet.getCell(column, row);
        System.out.println(cell.getFormattedValue());
        System.out.println();
    }
}

Or, if you are using the in-process mondrian driver, include mondrian.jar and its dependencies in your classpath, and change the appropriate lines in the above code to the following:

Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
Connection connection =
    DriverManager.getConnection(
        "jdbc:mondrian:"
        + "Jdbc='jdbc:odbc:MondrianFoodMart';"
        + "Catalog='file://c:/open/mondrian/demo/FoodMart.xml';"
        + "JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;");

Packages and Roadmap

The core API of olap4j version 1.0 is a Long Term Support (LTS) release, but some parts of the olap4j project will remain considered as experimental, thus subject to change in future releases.

Core packages are as follows:

The following packages are considered experimental and are subject to change:

Version 2.0

Olap4j version 2.0 is currently under development. Goals are:

  • Support metadata and API changes in recent SSAS (Microsoft SQL Server Analysis Services) and XMLA (XML for Analysis)
  • Support metadata and API changes in Mondrian version 4

We aim to be backwards compatible in the same way that each JDBC release is backwards compatible:

  • Applications developed against earlier versions will work against 2
  • Drivers supporting version 2 will also serve as 1.x drivers (JDBC version 4 broke this rule, and it was painful for driver developers)
  • Some work will be required to convert a version 1.x driver to a version 2 driver

Version 2 specification is here.

More information

General project information:

Related projects:

If you have downloaded a release:

  • README.txt describes the release structure.
  • CHANGES.txt describes what has changed in the release.
  • The VERSION.txt file holds the version number of the release.
Something went wrong with that request. Please try again.