Class ResultSet2FileSender

All Implemented Interfaces:
AdapterAware, HasPhysicalDestination, IBlockEnabledSender<QueryExecutionContext>, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, IXAEnabled, HasStatistics, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class ResultSet2FileSender extends FixedQuerySender
QuerySender that writes each row in a ResultSet to a file.
Author:
Peter Leeuwenburgh
  • Field Details

    • eolArray

      protected byte[] eolArray
  • Constructor Details

    • ResultSet2FileSender

      public ResultSet2FileSender()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: ISender
      configure() is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in the configure() or open() method, to improve performance.
      Specified by:
      configure in interface IConfigurable
      Specified by:
      configure in interface ISender
      Overrides:
      configure in class FixedQuerySender
      Throws:
      ConfigurationException
    • executeStatementSet

      protected PipeRunResult executeStatementSet(@Nonnull QueryExecutionContext queryExecutionContext, @Nonnull Message message, @Nonnull PipeLineSession session, @Nullable IForwardTarget next) throws SenderException, TimeoutException
      Overrides:
      executeStatementSet in class JdbcQuerySenderBase<QueryExecutionContext>
      Throws:
      SenderException
      TimeoutException
    • setStatusFieldType

      public void setStatusFieldType(String statusFieldType)
      type of the optional status field which is set after the row is written to the file: timestamp
    • setFileNameSessionKey

      @Deprecated @ConfigurationWarning("attribute \'fileNameSessionKey\' is replaced with \'filenameSessionKey\'") public void setFileNameSessionKey(String filenameSessionKey)
      Deprecated.
    • setFilenameSessionKey

      public void setFilenameSessionKey(String filenameSessionKey)
      Key of session variable that contains the name of the file to use.
    • setAppend

      public void setAppend(boolean b)
      If set true and the file already exists, the resultset rows are written to the end of the file.
      Default value
      false
    • setMaxRecordsSessionKey

      public void setMaxRecordsSessionKey(String maxRecordsSessionKey)
      If set (and >=0), this session key contains the maximum number of records which are processed. If query contains a group field (3), then also following records with the same group field value as the last record are processed
    • getFilenameSessionKey

      public String getFilenameSessionKey()
    • getStatusFieldType

      public String getStatusFieldType()
    • isAppend

      public boolean isAppend()
    • getMaxRecordsSessionKey

      public String getMaxRecordsSessionKey()