[Mondrian] about parseQuery()
Luc Boudreau
lucboudreau at gmail.com
Thu Mar 31 13:09:08 EDT 2011
Hi ^^
Take a look at this code. It shows how to parse MDX queries. There are also
other examples included in this demo project.
https://code.google.com/p/olap4j-demo/source/browse/trunk/src/org/devdonkey/olap4j/demo/MdxParserDemo.java
You might also be interested in the tutorial for olap4j.
http://olap4j-demo.googlecode.com/svn/trunk/doc/Olap4j_Introduction_An_end_user_perspective.pdf
Luc
On Thu, Mar 31, 2011 at 1:04 PM, Yang Guo <blizzaaard at gmail.com> wrote:
> I am trying to create a Query object from a string, like this:
>
> // Load the driver
>
> Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
>
>
>
> // Connect
>
> final Connection connection =
>
> DriverManager.getConnection(
>
> "jdbc:mondrian:"
>
> + "JdbcDrivers=com.mysql.jdbc.Driver;"
>
> + "Jdbc=jdbc:mysql://***:3306/***?user=***&password=***;"
>
> + "Catalog=file:***.xml;");
>
>
>
> // We are dealing with an olap connection. we must unwrap it.
>
> final OlapConnection olapConnection =
> connection.unwrap(OlapConnection.class);
>
>
>
> // Get a cube object.
>
> Cube peopleCube = olapConnection.getSchema().getCubes().get(
> "People");
>
>
>
> Query myQuery = connection.parseQuery("SELECT ...");
>
> It said there is no parseQuery() here:
>
> groovy.lang.MissingMethodException: No signature of method:
> mondrian.olap4j.FactoryJdbc4Impl$MondrianOlap4jConnectionJdbc4.parseQuery()
> is applicable for argument types: (java.lang.String) values: [SELECT ...]
>
>
> How do I use parseQuery()?
>
> Best,
> --
> Yang
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20110331/6436b127/attachment.html
More information about the Mondrian
mailing list