diff --git a/doc/olap4j_fs.html b/doc/olap4j_fs.html index 9a7c400..0bd4771 100644 --- a/doc/olap4j_fs.html +++ b/doc/olap4j_fs.html @@ -79,10 +79,10 @@

olap4j Specification

Authors: Julian Hyde, Barry Klawans
-Version: 0.9.5 (beta)
+Version: 0.9.7 (beta)
Revision: $Id: olap4j_fs.html 97 2008-06-09 11:33:50Z jhyde $ (log)
-Last modified: March 25th, 2008.

+Last modified: June 25th, 2009.


Contents

@@ -510,49 +510,49 @@

2.2. Connections

executes a statement:

+ import java.sql.*;
import org.olap4j.*;

Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
- OlapConnection connection =
+ Connection connection =
    DriverManager.getConnection(
-        "jdbc:mondrian:local:Jdbc=jdbc:odbc:MondrianFoodMart;" - +
-        "Catalog=/WEB-INF/queries/FoodMart.xml;" - +
-        "Role='California manager'");
+        "jdbc:mondrian:Jdbc=jdbc:odbc:MondrianFoodMart;"
+        + "Catalog=/WEB-INF/queries/FoodMart.xml;"
+        + "Role='California manager'");
OlapWrapper wrapper = (OlapWrapper) connection;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
OlapStatement statement = olapConnection.createStatement();

- OlapResult result =
-    statement.execute(
-        "SELECT {[Measures].[Unit Sales]} ON - COLUMNS,\n" +
-        "  {[Product].Members} ON - ROWS\n" +
-        "FROM [Sales]");
+ CellSet cellSet =
+    statement.executeOlapQuery(
+        "SELECT {[Measures].[Unit + Sales]} ON COLUMNS,\n"
+        + "  {[Product].Members} ON + ROWS\n"
+        + "FROM [Sales]");

Here's a piece of code to connect to Microsoft SQL Server Analysis -Services™ (MSAS) via XML/A. Note that besides the driver class and connect +Services™ (MSAS) via XML/A. Note that except for the driver class and connect string, the code is identical.

+ import java.sql.*;
import org.olap4j.*;

Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
- OlapConnection connection =
+ Connection connection =
    DriverManager.getConnection(
-         "jdbc:xmla:Server=http://localhost/xmla/msxisapi.dll;" - +
        "Catalog=FoodMart");
+         "jdbc:xmla:Server=http://localhost/xmla/msxisapi.dll;"
        + + "Catalog=FoodMart");
OlapWrapper wrapper = (OlapWrapper) connection;
OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
OlapStatement statement = connection.createStatement();

- CellSet result =
-     statement.execute(
-         "SELECT {[Measures].[Unit Sales]} ON - COLUMNS,\n" +
        "  {[Product].Members} ON - ROWS\n" +
        "FROM [Sales]");
+ CellSet cellSet =
+     statement.executeOlapQuery(
+         "SELECT {[Measures].[Unit + Sales]} ON COLUMNS,\n"
        + "  {[Product].Members} + ON ROWS\n"
        + "FROM [Sales]");

In the above examples, a statement was created from a string. As we shall see, a statement can also be created from an MDX parse tree.

@@ -581,18 +581,20 @@

2.2.1. Connection pooling

connection. For instance, if you were using DBCP, you could define and use a pooling olap4j data source as follows:

-
import org.apache.commons.dbcp.*;
+
import java.sql.*;
import org.olap4j.*;
+ import org.apache.commons.dbcp.*;

GenericObjectPool connectionPool =
    new GenericObjectPool(null);
ConnectionFactory connectionFactory =
    new DriverManagerConnectionFactory(
        - "jdbc:mondrian:local:Jdbc=jdbc:odbc:MondrianFoodMart;" +
+ "jdbc:mondrian:Jdbc=jdbc:odbc:MondrianFoodMart;"
        - "Catalog=/WEB-INF/queries/FoodMart.xml;" +
-        "Role='California manager'")
+ + "Catalog=/WEB-INF/queries/FoodMart.xml;"
+        + "Role='California manager'",
+        new Properties());
PoolableConnectionFactory poolableConnectionFactory =
    new PoolableConnectionFactory(
        connectionFactory, connectionPool, @@ -960,27 +962,33 @@

2.4. MDX query model

An MDX query model can be converted into a statement. For example,

+ import org.olap.*;
+ import org.olap4j.mdx.*;
+
// Create a query model.
+ OlapConnection connection;
SelectNode query = new SelectNode();
query.setFrom(
    new IdentifierNode(
        new - IdentifierNode.Segment("Sales")));
+ IdentifierNode.NameSegment("Sales")));
query.getAxisList().add(
    new AxisNode(
+        null,
        false,
+        Axis.ROWS,
+        new ArrayList<IdentifierNode>(),
        new CallNode(
+            null,
            "{}",
            Syntax.Braces,
            new IdentifierNode(
                - new IdentifierNode.Segment("Measures"),
+ new IdentifierNode.NameSegment("Measures"),
                - new IdentifierNode.Segment("Unit Sales"))),
-        Axis.ROWS,
-        new ArrayList<IdentifierNode>()));
+ new IdentifierNode.NameSegment("Unit Sales")))));

// Create a statement based upon the query model.
OlapStatement stmt;