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 FormModifier and Type | Field and Description |
---|---|
static String |
PREPARE_PARAMETER_PREFIX |
COMPONENT_EXECUTE_FAIL, MISSING_SESSION
EMPTYLOGID, 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, validate
debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, setLoggingLevel, setLogId
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getActionDefinition, getActionName, getComponentDefinition, getInstanceId, getMessages, getProcessId, getRuntimeContext, getSession, setActionDefinition, setActionName, setComponentDefinition, setComponentDefinitionMap, setInstanceId, setMessages, setProcessId, setRuntimeContext, setSession, validate
public static final String PREPARE_PARAMETER_PREFIX
public abstract boolean validateSystemSettings()
validateSystemSettings
in class org.pentaho.platform.engine.services.solution.ComponentBase
public abstract String getResultOutputName()
public abstract org.apache.commons.logging.Log getLogger()
getLogger
in class org.pentaho.platform.engine.core.system.PentahoBase
public org.pentaho.commons.connection.IPentahoResultSet getResultSet()
getResultSet
in interface org.pentaho.platform.api.data.IDataComponent
public boolean validateAction()
validateAction
in class org.pentaho.platform.engine.services.solution.ComponentBase
public void done()
done
in interface org.pentaho.platform.api.engine.IComponent
done
in class org.pentaho.platform.engine.services.solution.ComponentBase
public org.pentaho.commons.connection.IPentahoResultSet executePrepared(Map preparedParams)
executePrepared
in interface org.pentaho.platform.api.data.IPreparedComponent
preparedParams
- a map of possible parameters.public org.pentaho.commons.connection.IPentahoResultSet doQuery(SQLConnection sqlConnection, String query, boolean forwardOnlyResultset) throws Exception
Exception
public void dispose()
dispose
in interface org.pentaho.commons.connection.IDisposable
dispose
in interface org.pentaho.platform.api.data.IDataComponent
dispose
in interface org.pentaho.platform.api.data.IPreparedComponent
public int resolveParameter(String template, String parameter, Matcher parameterMatcher, int copyStart, StringBuffer results)
resolveParameter
in interface org.pentaho.platform.api.engine.IParameterResolver
resolveParameter
in class org.pentaho.platform.engine.services.solution.ComponentBase
template
- 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.IPreparedComponent
public boolean init()
init
in interface org.pentaho.platform.api.engine.IComponent
init
in class org.pentaho.platform.engine.services.solution.ComponentBase
public 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()