return reportSpecEntry;
}
public IPentahoResultSet getResultSet( final ReportSpec reportSpec ) throws Exception {
String jndiName = reportSpec.getReportSpecChoice().getJndiSource();
IPentahoConnection connection = null;
if ( reportSpec.getIsMDX() ) {
// did this ever work??
String connectStr = ""; //$NON-NLS-1$
IDBDatasourceService datasourceService = PentahoSystem.getObjectFactory().get( IDBDatasourceService.class, null );
String dsName = datasourceService.getDSBoundName( jndiName );
if ( dsName != null ) {
connectStr = "dataSource=" + dsName + "; Catalog=mondrian"; //$NON-NLS-1$ //$NON-NLS-2$
} else {
error( Messages.getInstance().getErrorString( "MDXBaseComponent.ERROR_0005_INVALID_CONNECTION" ) ); //$NON-NLS-1$
return null;
}
Properties props = new Properties();
props.setProperty( IPentahoConnection.CONNECTION, connectStr );
props.setProperty( IPentahoConnection.PROVIDER, reportSpec.getMondrianCubeDefinitionPath() );
connection =
PentahoConnectionFactory.getConnection( IPentahoConnection.MDX_DATASOURCE, props, getSession(), this );
} else {
connection =
PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName, getSession(), this );
}
String query = ReportParameterUtility.setupParametersForActionSequence( reportSpec.getQuery() );
query = setupQueryParameters( query );
IPentahoResultSet res = connection.executeQuery( query );
return res;
}