/**
   * @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;
  }