Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Mondrian

  1. #1
    Join Date
    Mar 2010
    Posts
    5

    Smile Mondrian

    Hello

    I recently have installed Mondrian and I successfly connect to it using this code:
    Code:
    import java.io.PrintWriter;
    import mondrian.olap.Connection;
    import mondrian.olap.DriverManager;
    import mondrian.olap.Query;
    import mondrian.olap.Result;
     
    public class requete {
     
     
      public void requete1 (){
      
      String connectString = "Provider=mondrian;" + 
      "Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&password=123;" +
       "Catalog=file:C:\\Tomcat 6.0\\webapps\\mondrian\\WEB-INF\\queries\\FoodMart.xml;"+ 
      "JdbcDrivers=com.mysql.jdbc.Driver";
      System.out.println(connectString);
      Connection connection = null;
      connection = DriverManager.getConnection(connectString, null);
      Query query = connection.parseQuery("SELECT {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} on columns," +
      "{([Promotion Media].[All Media], [Product].[All Products])} ON rows "+
      "FROM Sales " +
      "WHERE ([Time].[1997])"); 
      Result result = connection.execute(query);
      result.print(new PrintWriter(System.out,true)); 
      }
      
      
      public static void main (String[] args){
       new requete().requete1();
        
      }
      }
    Now I Want to represent the result in an array and a chart form.
    Please, is there a Java code that allow me to draw my data. It's very urgent.
    Thanks

  2. #2

    Default

    JFreechart
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: chat.freenode.net Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(http://analytical-labs.com)

    http://mattlittle.files.wordpress.co...-bananaman.jpg

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.