use of org.pentaho.di.core.database.DataSourceNamingException in project pdi-platform-plugin by pentaho.
the class PlatformKettleDataSourceProvider method getNamedDataSourceFromService.
protected <T extends IDBDatasourceService> DataSource getNamedDataSourceFromService(Class<T> dataSourceServiceInterface, String dataSourceName) throws DataSourceNamingException {
T datasourceService = PentahoSystem.get(dataSourceServiceInterface, null);
IDBDatasourceService service = (datasourceService == null) ? PentahoSystem.get(IDBDatasourceService.class, null) : datasourceService;
if (service != null) {
try {
return service.getDataSource(dataSourceName);
} catch (DBDatasourceServiceException ex) {
throw new DataSourceNamingException(ex);
}
}
return null;
}
use of org.pentaho.di.core.database.DataSourceNamingException in project pentaho-platform by pentaho.
the class PlatformKettleDataSourceProvider method getNamedDataSourceFromService.
protected <T extends IDBDatasourceService> DataSource getNamedDataSourceFromService(Class<T> dataSourceServiceInterface, String dataSourceName) throws DataSourceNamingException {
T datasourceService = PentahoSystem.get(dataSourceServiceInterface, null);
IDBDatasourceService service = (datasourceService == null) ? PentahoSystem.get(IDBDatasourceService.class, null) : datasourceService;
if (service != null) {
try {
return service.getDataSource(dataSourceName);
} catch (DBDatasourceServiceException ex) {
throw new DataSourceNamingException(ex);
}
}
return null;
}
Aggregations