Package com.simplicite.util.integration
Class SQLAdapter
- java.lang.Object
-
- com.simplicite.util.integration.SimpleAdapter
-
- com.simplicite.util.integration.SimpleSQLAdapter
-
- com.simplicite.util.integration.SQLAdapter
-
- All Implemented Interfaces:
AdapterInterface
,java.io.Serializable
public abstract class SQLAdapter extends SimpleSQLAdapter
Abstract adapter dedicated to SQL query input streams
The only method to implement is the single line level processRow() method
The SQL query is provided as the input stream- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SQLAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSQL()
Get SQL queryvoid
process()
Executes each SQL (or the single one set by setSQL) query and iterates on results
Each result line is passed to the processLine() method for processingjava.lang.String
processHead(java.lang.String[] head)
Select result header processing.abstract java.lang.String
processRow(long rowNumber, java.lang.String[] row)
Select result row processing to implementjava.lang.String
processSelect(java.lang.String sql, java.util.List<java.lang.String[]> rows)
Iterates on select results and calls processHead and processRowjava.lang.String
processUpdate(java.lang.String sql, int result)
Update result processing.void
setSQL(java.lang.String sql)
Set SQL query-
Methods inherited from class com.simplicite.util.integration.SimpleSQLAdapter
getDataSource, preProcess, setDataSource
-
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
-
getSQL
public final java.lang.String getSQL()
Get SQL query
-
setSQL
public final void setSQL(java.lang.String sql)
Set SQL query
-
process
public void process() throws java.lang.InterruptedException
Executes each SQL (or the single one set by setSQL) query and iterates on results
Each result line is passed to the processLine() method for processing- Specified by:
process
in interfaceAdapterInterface
- Overrides:
process
in classSimpleSQLAdapter
- Throws:
java.lang.InterruptedException
-
processSelect
public final java.lang.String processSelect(java.lang.String sql, java.util.List<java.lang.String[]> rows) throws PlatformException, java.lang.InterruptedException
Iterates on select results and calls processHead and processRow- Specified by:
processSelect
in classSimpleSQLAdapter
- Parameters:
sql
- SQL statementrows
- Result rows (including headers)- Throws:
PlatformException
java.lang.InterruptedException
-
processHead
public java.lang.String processHead(java.lang.String[] head) throws PlatformException
Select result header processing. Does nothing by default, can be overriden if required
- Parameters:
head
- Result header- Returns:
- Processed header as Simplicite XML statements or null
- Throws:
PlatformException
-
processRow
public abstract java.lang.String processRow(long rowNumber, java.lang.String[] row) throws PlatformException, java.lang.InterruptedException
Select result row processing to implement
- Parameters:
rowNumber
- Input row number (1 is the first line)row
- Input row values- Returns:
- Processed row as Simplicite XML statements or null
- Throws:
PlatformException
java.lang.InterruptedException
-
processUpdate
public java.lang.String processUpdate(java.lang.String sql, int result) throws PlatformException
Update result processing. Does nothing by default, can be overriden if required
- Specified by:
processUpdate
in classSimpleSQLAdapter
- Parameters:
sql
- SQL statementresult
- Result- Throws:
PlatformException
-
-