// Check if this is a prepared query that will be executed later. If so cache the
// query and set this component as the output. This query will be run later from a subreport.
if ( relationalDbAction.getOutputPreparedStatement() != null ) {
prepareQuery( baseQuery );
IActionOutput actionOutput = relationalDbAction.getOutputPreparedStatement();
if ( actionOutput != null ) {
actionOutput.setValue( this );
}
return true;
}
// TODO not sure if this should be allowed without connection ownership?
// int maxRows = relationalDbAction.getMaxRows().getIntValue(-1);
if ( maxRowsInput != ActionInputConstant.NULL_INPUT ) {
this.setMaxRows( maxRowsInput.getIntValue() );
}
// Added by Arijit Chatterjee.Sets the value of timeout. Default is -1, if parameter not found.
if ( queryTimeoutInput != ActionInputConstant.NULL_INPUT ) {
this.setQueryTimeout( queryTimeoutInput.getIntValue() );
}
if ( relationalDbAction.getPerformTransform().getBooleanValue( false ) ) {
runQuery( baseQuery, false ); // The side effect of
// transform rSet here
rSet =
PentahoDataTransmuter.crossTab( rSet, relationalDbAction.getTransformPivotColumn().getIntValue( -1 ) - 1,
relationalDbAction.getTransformMeasuresColumn().getIntValue( -1 ) - 1, relationalDbAction
.getTransformSortColumn().getIntValue( 0 ) - 1, (Format) relationalDbAction
.getTransformPivotDataFormat().getValue(), (Format) relationalDbAction
.getTransformSortDataFormat().getValue(), relationalDbAction.getTransformOrderOutputColumns()
.getBooleanValue( false ) );
IActionOutput actionOutput = relationalDbAction.getOutputResultSet();
if ( actionOutput != null ) {
actionOutput.setValue( rSet );
}
return true;
} else {
return runQuery( baseQuery, relationalDbAction.getLive().getBooleanValue( false ) );
}
} else if ( actionDefinition instanceof SqlConnectionAction ) {
SqlConnectionAction sqlConnectionAction = (SqlConnectionAction) actionDefinition;
dispose();
connection = getDatasourceConnection();
if ( connection == null ) {
return false;
} else {
IActionOutput actionOutput = sqlConnectionAction.getOutputConnection();
if ( actionOutput != null ) {
actionOutput.setValue( this );
return true;
} else {
return false;
}
}