Class DataLoader

java.lang.Object
de.businesscode.bcdui.wrs.load.DataLoader

public class DataLoader extends Object
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.
  • Constructor Details

  • Method Details

    • getOptions

      protected final IRequestOptions getOptions()
      Returns:
      the options
    • getGenerator

      protected final ISqlGenerator getGenerator()
      Returns:
      the generator
    • getDataWriter

      protected final IDataWriter 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

      public void run() throws Exception
      run
      Throws:
      Exception
    • prepareStatement

      protected PreparedStatement prepareStatement(Connection connection, String sql) throws Exception
      Create the prepared statement Clients can overwrite this method to implement same logic
      Parameters:
      connection -
      sql -
      Returns:
      the statement
      Throws:
      Exception
    • executeQuery

      protected ResultSet executeQuery(PreparedStatement statement) throws Exception
      Execute query generated by the generator Clients can overwrite this method to implement same logic
      Parameters:
      statement -
      Returns:
      the result set
      Throws:
      Exception
    • writeResult

      protected void writeResult(ResultSet resultSet) throws Exception
      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