Package org.pentaho.platform.api.data

Examples of org.pentaho.platform.api.data.IDatasourceService


import org.pentaho.platform.engine.core.system.PentahoSystem;

public class PentahoDataSourceResolver implements DataSourceResolver {
  Logger logger = Logger.getLogger(PentahoDataSourceResolver.class);
  public DataSource lookup(String dataSourceName) throws Exception {
    IDatasourceService datasourceSvc =
      PentahoSystem.getObjectFactory().get(
          IDatasourceService.class,
          PentahoSessionHolder.getSession());
    javax.sql.DataSource datasource;
    try {
      datasource =
        datasourceSvc.getDataSource(
            datasourceSvc.getDSUnboundName(dataSourceName));
    }
    catch (DatasourceServiceException e) {
      Context initContext = new InitialContext();
      if (dataSourceName != null && !dataSourceName.startsWith("java:/comp/env/")) {
        dataSourceName = "java:/comp/env/" + dataSourceName;
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.data.IDatasourceService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.