Exemplo n.º 1
0
  /**
   * @see
   *     com.eyeq.pivot4j.analytics.datasource.AbstractDataSourceManager#createDataSourceDefinition(org.apache.commons.configuration.HierarchicalConfiguration)
   */
  @Override
  protected SimpleDataSourceInfo createDataSourceDefinition(
      HierarchicalConfiguration configuration) {
    SimpleDataSourceInfo definition = new SimpleDataSourceInfo();
    definition.restoreSettings(configuration);

    return definition;
  }
Exemplo n.º 2
0
  /** @see com.eyeq.pivot4j.analytics.datasource.DataSourceManager#getCatalogs() */
  @Override
  public List<CatalogInfo> getCatalogs() {
    List<CatalogInfo> catalogs = new LinkedList<CatalogInfo>();

    for (SimpleDataSourceInfo definition : getDefinitions()) {
      catalogs.add(
          new CatalogInfo(definition.getName(), definition.getName(), definition.getDescription()));
    }

    return catalogs;
  }
Exemplo n.º 3
0
  /**
   * @see
   *     com.eyeq.pivot4j.analytics.datasource.AbstractDataSourceManager#createDataSource(com.eyeq.pivot4j.analytics.datasource.DataSourceInfo)
   */
  @Override
  protected OlapDataSource createDataSource(SimpleDataSourceInfo definition) {
    if (definition == null) {
      throw new NullArgumentException("definition");
    }

    String driverName = definition.getDriverClass();

    try {
      Class.forName(driverName);
    } catch (ClassNotFoundException e) {
      String msg = "Failed to load JDBC driver : " + driverName;
      throw new FacesException(msg, e);
    }

    SimpleOlapDataSource dataSource = new SimpleOlapDataSource();

    dataSource.setConnectionString(definition.getUrl());
    dataSource.setUserName(definition.getUserName());
    dataSource.setPassword(definition.getPassword());
    dataSource.setConnectionProperties(definition.getProperties());

    return dataSource;
  }