public abstract class SQLBaseComponent
extends org.pentaho.platform.engine.services.solution.ComponentBase
implements org.pentaho.platform.api.data.IDataComponent, org.pentaho.platform.api.data.IPreparedComponent, org.pentaho.platform.api.engine.IParameterResolver
SQLExecute,
SQLLookupRule,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static String |
PREPARE_PARAMETER_PREFIX |
COMPONENT_EXECUTE_FAIL, MISSING_SESSIONEMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR| Constructor and Description |
|---|
SQLBaseComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
dispose of the resultset, and if the owner, dispose of the connection.
|
void |
done()
nothing to do in done call from runtime context.
|
org.pentaho.commons.connection.IPentahoResultSet |
doQuery(SQLConnection sqlConnection,
String query,
boolean forwardOnlyResultset) |
org.pentaho.commons.connection.IPentahoResultSet |
executePrepared(Map preparedParams)
executes a prepared method that returns a result set executePrepared looks up any "PREPARELATER" params in the
preparedParams map.
|
org.pentaho.commons.connection.IPentahoConnection |
getDatasourceConnection()
attempt to aquire a connection.
|
abstract org.apache.commons.logging.Log |
getLogger() |
int |
getMaxRows() |
String |
getQuery() |
int |
getQueryTimeout() |
boolean |
getReadOnly() |
abstract String |
getResultOutputName() |
org.pentaho.commons.connection.IPentahoResultSet |
getResultSet()
returns the result set object
|
boolean |
init()
nothing is done in the init function
|
int |
resolveParameter(String template,
String parameter,
Matcher parameterMatcher,
int copyStart,
StringBuffer results)
This method is called when TemplateUtil.applyTemplate() encounters a parameter.
|
void |
setMaxRows(int value) |
void |
setQueryTimeout(int timeInSec) |
void |
setReadOnly(boolean value) |
org.pentaho.commons.connection.IPentahoConnection |
shareConnection()
return this class's connection.
|
boolean |
validateAction()
validates the action.
|
abstract boolean |
validateSystemSettings() |
createFeedbackParameter, createFeedbackParameter, createNewInstance, execute, getActionDefinition, getActionName, getActionTitle, getComponentDefinition, getComponentDefinition, getId, getInitFailMessage, getInitOk, getInstanceId, getLogId, getObjectName, getProcessId, getResourceAsString, getRuntimeContext, getSession, inputMissingError, outputMissingError, promptNeeded, promptNow, resourceComponentSettingError, resourceMissingError, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setInstanceId, setProcessId, setRuntimeContext, setSession, validatedebug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warngenLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, setLoggingLevel, setLogIdequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, getActionDefinition, getActionName, getComponentDefinition, getInstanceId, getMessages, getProcessId, getRuntimeContext, getSession, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setInstanceId, setMessages, setProcessId, setRuntimeContext, setSession, validatepublic static final String PREPARE_PARAMETER_PREFIX
public abstract boolean validateSystemSettings()
validateSystemSettings in class org.pentaho.platform.engine.services.solution.ComponentBasepublic abstract String getResultOutputName()
public abstract org.apache.commons.logging.Log getLogger()
getLogger in class org.pentaho.platform.engine.core.system.PentahoBasepublic org.pentaho.commons.connection.IPentahoResultSet getResultSet()
getResultSet in interface org.pentaho.platform.api.data.IDataComponentpublic boolean validateAction()
validateAction in class org.pentaho.platform.engine.services.solution.ComponentBasepublic void done()
done in interface org.pentaho.platform.api.engine.IComponentdone in class org.pentaho.platform.engine.services.solution.ComponentBasepublic org.pentaho.commons.connection.IPentahoResultSet executePrepared(Map preparedParams)
executePrepared in interface org.pentaho.platform.api.data.IPreparedComponentpreparedParams - a map of possible parameters.public org.pentaho.commons.connection.IPentahoResultSet doQuery(SQLConnection sqlConnection, String query, boolean forwardOnlyResultset) throws Exception
Exceptionpublic void dispose()
dispose in interface org.pentaho.commons.connection.IDisposabledispose in interface org.pentaho.platform.api.data.IDataComponentdispose in interface org.pentaho.platform.api.data.IPreparedComponentpublic int resolveParameter(String template, String parameter, Matcher parameterMatcher, int copyStart, StringBuffer results)
resolveParameter in interface org.pentaho.platform.api.engine.IParameterResolverresolveParameter in class org.pentaho.platform.engine.services.solution.ComponentBasetemplate - the source stringparameter - the parameter valueparameterMatcher - the regex parameter matchercopyStart - the start of the copyresults - the output resultpublic org.pentaho.commons.connection.IPentahoConnection getDatasourceConnection()
public org.pentaho.commons.connection.IPentahoConnection shareConnection()
shareConnection in interface org.pentaho.platform.api.data.IPreparedComponentpublic boolean init()
init in interface org.pentaho.platform.api.engine.IComponentinit in class org.pentaho.platform.engine.services.solution.ComponentBasepublic int getQueryTimeout()
public void setQueryTimeout(int timeInSec)
public int getMaxRows()
public void setMaxRows(int value)
public String getQuery()
public void setReadOnly(boolean value)
public boolean getReadOnly()