Package com.simplicite.util.integration
Class SimpleSQLAdapter
- java.lang.Object
-
- com.simplicite.util.integration.SimpleAdapter
-
- com.simplicite.util.integration.SimpleSQLAdapter
-
- All Implemented Interfaces:
AdapterInterface
,java.io.Serializable
- Direct Known Subclasses:
SQLAdapter
public abstract class SimpleSQLAdapter extends SimpleAdapter
Abstract adapter dedicated to SQL statements input streams
The only methods to implement are the processQuery and processUpdate methods- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleSQLAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDataSource()
Get target datasource name (null means default datasource)java.lang.String
preProcess()
Called before processing lines, by default it sends the XML header to outputvoid
process()
Processes each SQL statement
Each result line is passed to the processQuery or processUpdate method for SQL result processingabstract java.lang.String
processSelect(java.lang.String sql, java.util.List<java.lang.String[]> rows)
Select result processingabstract java.lang.String
processUpdate(java.lang.String sql, int result)
Update result processingvoid
setDataSource(java.lang.String datasource)
Set target datasource name (null means default datasource)-
Methods inherited from class com.simplicite.util.integration.SimpleAdapter
append, appendError, appendError, appendLog, appendLog, close, directProcess, getBooleanParameter, getBooleanParameter, getConsole, getErrorStream, getErrorWriter, getGrant, getInputReader, getInputStream, getIntParameter, getIntParameter, getLogStream, getLogWriter, getLongParameter, getLongParameter, getName, getOrigin, getOutputStream, getOutputWriter, getParameter, getParameter, getParameters, getProcessCount, getStatus, getTrackingId, init, postProcess, setConsole, setErrorStream, setInputData, setInputStream, setLogStream, setOutputStream, setParameter, setParameter, setParameter, setParameter, setProcessCount, setStatus
-
-
-
-
Method Detail
-
preProcess
public java.lang.String preProcess()
Description copied from class:SimpleAdapter
Called before processing lines, by default it sends the XML header to output- Specified by:
preProcess
in interfaceAdapterInterface
- Overrides:
preProcess
in classSimpleAdapter
- Returns:
- Error code to stop, or null to continue
-
getDataSource
public final java.lang.String getDataSource()
Get target datasource name (null means default datasource)
-
setDataSource
public final void setDataSource(java.lang.String datasource)
Set target datasource name (null means default datasource)
-
process
public void process() throws java.lang.InterruptedException
Processes each SQL statement
Each result line is passed to the processQuery or processUpdate method for SQL result processing- Throws:
java.lang.InterruptedException
-
processSelect
public abstract java.lang.String processSelect(java.lang.String sql, java.util.List<java.lang.String[]> rows) throws PlatformException, java.lang.InterruptedException
Select result processing
- Parameters:
sql
- SQL statementrows
- Result rows (including headers)- Throws:
PlatformException
java.lang.InterruptedException
-
processUpdate
public abstract java.lang.String processUpdate(java.lang.String sql, int result) throws PlatformException, java.lang.InterruptedException
Update result processing
- Parameters:
sql
- SQL statementresult
- Result- Throws:
PlatformException
java.lang.InterruptedException
-
-