Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: [Mondrian] about parseQuery()

  1. #1
    Yang Guo Guest

    Default [Mondrian] about parseQuery()

    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 (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  2. #2
    Luc Boudreau Guest

    Default Re: [Mondrian] about parseQuery()

    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-dem...arserDemo.java

    You might also be interested in the tutorial for olap4j.

    http://olap4j-demo.googlecode.com/sv...erspective.pdf

    Luc


    On Thu, Mar 31, 2011 at 1:04 PM, Yang Guo <blizzaaard (AT) gmail (DOT) 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 (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.