Package de.businesscode.bcdui.wrs.load
Class DataLoader
java.lang.Object
de.businesscode.bcdui.wrs.load.DataLoader
This algorithms
reads input from input options,
uses generator to interpret the options (generate SQL),
executes sql and
writes the resultSet out into the writer.
reads input from input options,
uses generator to interpret the options (generate SQL),
executes sql and
writes the resultSet out into the writer.
-
Constructor Summary
ConstructorsConstructorDescriptionDataLoader
(IRequestOptions options, ISqlGenerator generator, IDataWriter dataWriter) DataLoader -
Method Summary
Modifier and TypeMethodDescriptionprotected ResultSet
executeQuery
(PreparedStatement statement) Execute query generated by the generator Clients can overwrite this method to implement same logicprotected final IDataWriter
final long
protected final ISqlGenerator
protected final IRequestOptions
long
long
long
boolean
isEmpty()
isEmptyprotected PreparedStatement
prepareStatement
(Connection connection, String sql) Create the prepared statement Clients can overwrite this method to implement same logicvoid
run()
runprotected void
writeResult
(ResultSet resultSet) Write result out using the data writer.
-
Constructor Details
-
DataLoader
DataLoader- Parameters:
options
-generator
-dataWriter
-
-
-
Method Details
-
getOptions
- Returns:
- the options
-
getGenerator
- Returns:
- the generator
-
getDataWriter
- Returns:
- the dataWriter
-
isEmpty
public boolean isEmpty()isEmpty- Returns:
- true if no query was specified from the request
-
getExecuteDuration
public final long getExecuteDuration()- Returns:
- the sql execution executeDuration
-
getWriteDuration
public long getWriteDuration()- Returns:
- the writeDuration
-
getRsStartTime
public long getRsStartTime()- Returns:
- the rsStartTime
-
getRsEndTime
public long getRsEndTime()- Returns:
- the rsEndTime
-
run
run- Throws:
Exception
-
prepareStatement
Create the prepared statement Clients can overwrite this method to implement same logic- Parameters:
connection
-sql
-- Returns:
- the statement
- Throws:
Exception
-
executeQuery
Execute query generated by the generator Clients can overwrite this method to implement same logic- Parameters:
statement
-- Returns:
- the result set
- Throws:
Exception
-
writeResult
Write result out using the data writer. Clients can overwrite this method to implement same logic- Parameters:
resultSet
- - data to write out. Can be null if generator was empty- Throws:
Exception
-