Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package pt.webdetails.cda.dataaccess;
 
 import  org.apache.commons.logging.Log;
 import  org.apache.commons.logging.LogFactory;
 import  org.dom4j.Element;
import  org.pentaho.reporting.engine.classic.core.DataFactory;
import  org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.AbstractNamedMDXDataFactory;
import  org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.BandedMDXDataFactory;
Implementation of a DataAccess that will get data from a SQL database

User: pedro Date: Feb 3, 2010 Time: 12:18:05 PM

public class Olap4JDataAccess extends PREDataAccess {
  private static final Log logger = LogFactory.getLog(Olap4JDataAccess.class);
  public Olap4JDataAccess(final Element element) {
    super(element);
  }
  public Olap4JDataAccess() {
  }
  protected AbstractNamedMDXDataFactory createDataFactory() throws UnknownConnectionExceptionInvalidConnectionException {
    return new BandedMDXDataFactory(connection.getInitializedConnectionProvider());
  }
    .debug("Creating BandedMDXDataFactory");
    final AbstractNamedMDXDataFactory mdxDataFactory = createDataFactory();
    // using deprecated method for 3.10 support
    mdxDataFactory.setQuery("query"getQuery());
    mdxDataFactory.setJdbcPasswordField(connection.getPasswordField());
    mdxDataFactory.setJdbcUserField(connection.getUserField());
    mdxDataFactory.setRoleField(connection.getRoleField());
    return mdxDataFactory;
  }
  public String getType() {
    return "olap4j";
  }
    return .;
  }
New to GrepCode? Check out our FAQ X