Class SQLExecute

  • All Implemented Interfaces:
    Serializable, org.pentaho.commons.connection.IDisposable, org.pentaho.platform.api.data.IDataComponent, org.pentaho.platform.api.data.IPreparedComponent, org.pentaho.platform.api.engine.IAuditable, org.pentaho.platform.api.engine.IComponent, org.pentaho.platform.api.engine.ILogger, org.pentaho.platform.api.engine.IParameterResolver

    public class SQLExecute
    extends SQLLookupRule
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.pentaho.platform.engine.services.solution.ComponentBase

        COMPONENT_EXECUTE_FAIL, debug, MISSING_SESSION, UNKNOWN_COMPONENT_ID
      • Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase

        EMPTYLOGID, loggingLevel, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
      • Fields inherited from interface org.pentaho.platform.api.engine.ILogger

        ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
      • Fields inherited from interface org.pentaho.platform.api.data.IPreparedComponent

        PREPARE_LATER_INTER_PREFIX, PREPARE_LATER_PLACEHOLDER, PREPARE_LATER_PREFIX, PREPARED_COMPONENT_NAME, PREPARED_OUTPUT_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      SQLExecute()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addErrorCode​(org.pentaho.commons.connection.memory.MemoryResultSet affectedRowsResultSet, SQLException e, String failMsg)  
      org.apache.commons.logging.Log getLogger()  
      static String removeLineTerminators​(String inputStr)  
      protected boolean runQuery​(String rawQuery, boolean live)
      executes the specified query template.
      protected boolean runSqlQuery​(SQLConnection conn, String rawQuery, boolean live)  
      boolean validateAction()
      validates the action.
      • Methods inherited from class org.pentaho.platform.engine.services.solution.ComponentBase

        addTempParameter, addTempParameterObject, applyInputsToFormat, audit, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createFeedbackParameter, createNewInstance, execute, feedbackAllowed, getActionDefinition, getActionName, getActionTitle, getComponentDefinition, getComponentDefinition, getContentOutputItem, getDefaultOutputStream, getFeedbackOutputStream, getId, getInitFailMessage, getInitOk, getInputBooleanValue, getInputLongValue, getInputNames, getInputParameter, getInputStream, getInputStringValue, getInputStringValue, getInputValue, getInstanceId, getLogId, getObjectName, getOutputContentItem, getOutputContentItem, getOutputItem, getOutputItem, getOutputNames, getOutputPreference, getProcessId, getResource, getResourceAsString, getResourceDataSource, getResourceInputStream, getResourceNames, getRuntimeContext, getSession, getSetting, getSolutionName, getSolutionPath, getStringSetting, inputMissingError, isDefinedInput, isDefinedOutput, isDefinedResource, isPromptPending, outputMissingError, promptNeeded, promptNow, resourceComponentSettingError, resourceMissingError, saveSetting, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setFeedbackMimeType, setInstanceId, setOutputMimeType, setOutputMimeType, setOutputValue, setProcessId, setRuntimeContext, setSession, validate
      • Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger

        debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
      • Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase

        genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, setLoggingLevel, setLogId
      • Methods inherited from interface org.pentaho.platform.api.engine.IAuditable

        getId, getObjectName
      • Methods inherited from interface org.pentaho.platform.api.engine.IComponent

        execute, getActionDefinition, getActionName, getComponentDefinition, getInstanceId, getMessages, getProcessId, getRuntimeContext, getSession, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setInstanceId, setMessages, setProcessId, setRuntimeContext, setSession, validate
      • Methods inherited from interface org.pentaho.platform.api.engine.ILogger

        debug, debug, error, error, fatal, fatal, getLoggingLevel, info, info, setLoggingLevel, trace, trace, warn, warn
    • Constructor Detail

      • SQLExecute

        public SQLExecute()
    • Method Detail

      • validateAction

        public boolean validateAction()
        Description copied from class: SQLBaseComponent
        validates the action. checks to verify inputs are available to execute - verify query is available - verify connection is available, via jndi, connection string, or prepared component - verify output is specified
        Overrides:
        validateAction in class SQLBaseComponent
      • runQuery

        protected boolean runQuery​(String rawQuery,
                                   boolean live)
        Description copied from class: SQLBaseComponent
        executes the specified query template. The query template is first formatted and then executed. If live, the original result set is made available as an output. If not live, the result set is converted into memory and the connection and live result set are closed.
        Overrides:
        runQuery in class SQLBaseComponent
        Parameters:
        rawQuery - query template
        live - returns original result set if true, memory result set if false
        Returns:
        true if successful
      • runSqlQuery

        protected boolean runSqlQuery​(SQLConnection conn,
                                      String rawQuery,
                                      boolean live)
      • addErrorCode

        public void addErrorCode​(org.pentaho.commons.connection.memory.MemoryResultSet affectedRowsResultSet,
                                 SQLException e,
                                 String failMsg)
      • removeLineTerminators

        public static String removeLineTerminators​(String inputStr)