There are many things happening behind the scenes here in R&D of Jedox. Besides keeping pace with release plan and supporting customer projects, our team also ensures to stay compatible with the trends outside. Few years ago, Julian Hyde, founder of the Mondrian project, asked if we would like to join his initiative of developing olap4j – open Java API for accessing OLAP data. You can look at it as JDBC of OLAP world.
We agreed to join in although we had very few, if at all relation to it back then. Time has passed, we eventually developed our ODBO/MDX Provider on top of Palo OLAP Server and olap4j slowly but steadily grew to unwritten standard. Last year, we’ve seen couple of applications emerging (e.g. Wabit) that already use olap4j and are able to connect to Palo.
Recently olap4j project announced that it will soon be reaching version 1.0. Vlado, our Head of R&D used this opportunity to test it against Palo. Apparently there was not much work to do. He just checked out latest source code, built it and he was ready to write his first olap4j based application. He used provided “hello world” sample. All he had to do is to adjust connection string to match the properties of Palo XMLA endpoint.
This is how this sample looks like:
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import org.olap4j.CellSet;
import org.olap4j.OlapConnection;
import org.olap4j.OlapStatement;
import org.olap4j.OlapWrapper;
import org.olap4j.driver.xmla.XmlaOlap4jDriver;
import org.olap4j.layout.RectangularCellSetFormatter;
public class PaloConnection {
public static void main(String[] args) throws Exception {
Class.forName(“org.olap4j.driver.xmla.XmlaOlap4jDriver”);
Connection connection =
DriverManager.getConnection(
”jdbc:xmla:Server=http://localhost:4242;”
+ “User=’admin’;”
+ “Password=’admin’;”
+ “Catalog=FoodMart2005Palo;”
+ “Cube=Budget”);
OlapWrapper wrapper = (OlapWrapper) connection;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
OlapStatement statement = olapConnection.createStatement();
CellSet cellSet =
statement.executeOlapQuery(
”SELECT {[store].[USA]} ON COLUMNS , {[Account].[1000]} ON ROWS\n”
+ “FROM [Budget]“);
RectangularCellSetFormatter formatter =
new RectangularCellSetFormatter(false);
PrintWriter writer = new PrintWriter(System.out);
formatter.format(cellSet, writer);
writer.flush();
statement.close();
connection.close();
}
}














Recent Comments