protected boolean executeAction() {
boolean returnValue = true;
try {
if ( getActionDefinition() instanceof HQLQueryAction ) {
HQLQueryAction queryAction = (HQLQueryAction) getActionDefinition();
String[] classNames = null;
String query = queryAction.getQuery().getStringValue();
if ( queryAction.getInputSharedConnection() != ActionInputConstant.NULL_INPUT ) {
connectionOwner = false;
IPreparedComponent component = (IPreparedComponent) queryAction.getInputSharedConnection().getValue();
IPentahoConnection conn = component.shareConnection();
if ( IPentahoConnection.HQL_DATASOURCE.equals( conn.getDatasourceType() ) ) {
connection = conn;
} else {
connection = null;
returnValue = false;
error( Messages.getInstance().getErrorString(
"IPreparedComponent.ERROR_0001_INVALID_CONNECTION_TYPE", getActionName() ) ); //$NON-NLS-1$
}
} else {
createBasicConnection( queryAction, classNames );
}
if ( connection != null ) {
IActionOutput actionOutput = queryAction.getOutputPreparedStatementParam();
if ( actionOutput != null ) {
// prepare the query for execution, but don't execute quite yet.
prepareQuery( query );
// set the output as self, which will be used later by another component.