title: How to use olap4j api to get the mysql column names from the schema file
body: <p>I am beginner with the <code>BI</code> concepts and <code>mondrian</code> .I am using <code>olap4j API</code> with <code>mondrian</code> server and my requirement is to get the mysql column names mapped in the schema file or metadata about the database . Basically i am able to connect and can execute a sample query with the <code>foodmart</code> sample data. Please provide me the sample code to get the columns names (i am using mysql) or db metadata</p>
  
  <p>Sample code i am trying is</p>
  
  <pre><code>        Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
          Connection connection = DriverManager
                  .getConnection("jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/foodmart;Provider=Mondrian;"
                          + "Catalog=D:/Softwares/mondrian-3.2.0.13661/demo/FoodMart.xml;PoolNeeded=false;JdbcUser=root;JdbcPassword=admin123;JdbcDrivers=com.mysql.jdbc.Driver;");
  
          OlapWrapper wrapper = (OlapWrapper) connection;
          OlapConnection olapConnection = wrapper
                  .unwrap(OlapConnection.class);
  
          NamedList&lt;Cube&gt; cubes = olapConnection.getOlapSchema().getCubes();
          for (Cube eachCube : cubes) {
  
              System.out.println(" Cube name..." + eachCube.getName());
  
              for (Measure measure : eachCube.getMeasures()) {
  
                  System.out.println(" Measures " + measure.getName());
                  System.out.println("Measure Levels...."
                          + measure.getLevel().getCaption());
  
              }
  
              for (Hierarchy hierarchy : eachCube.getHierarchies()) {
  
                  System.out.println("hierarchy " + hierarchy.getName());
                  NamedList&lt;Level&gt; levels = hierarchy.getLevels();
  
                  for (Level l : levels) {
  
                      System.out.println(" Hierarchy levels " + l.getName());
                      List&lt;Member&gt; members = l.getMembers();
  
                      for(Member member:members){
                          System.out.println(" Member name " +member.getName());
  
  
                      }
  
                  }
              }
  
          }
  </code></pre>