Class BasicStreamingDataset

    • Constructor Detail

      • BasicStreamingDataset

        public BasicStreamingDataset()
      • BasicStreamingDataset

        public BasicStreamingDataset​(java.util.List<java.lang.String> columnNames,
                                     java.util.List<java.lang.Class<?>> columnTypes)
      • BasicStreamingDataset

        public BasicStreamingDataset​(java.sql.ResultSet rs)
                              throws java.sql.SQLException
        Creates a dataset by streaming the results of a JDBC ResultSet
        Throws:
        java.sql.SQLException
    • Method Detail

      • getError

        public java.lang.Exception getError()
      • initialize

        public void initialize​(java.lang.String[] columnNames,
                               java.lang.Class<?>[] columnTypes,
                               boolean supportsQuality,
                               int expectedRows)
        Description copied from interface: StreamingDatasetWriter
        Initializes the streaming dataset with important information, primarily the column names and types. If supportsQuality is true, it is expected that every value added has an associated quality. expectedRows gives an idea as to how many rows will be returned- useful for progress indication. Should be -1 if the number cannot be known in advance.
        Specified by:
        initialize in interface StreamingDatasetWriter
        expectedRows - -1 if not known, otherwise the number of rows that will be in the dataset.
      • write

        public void write​(java.lang.Object[] data,
                          QualityCode[] quality)
        Description copied from interface: StreamingDatasetWriter
        Writes a row with the given data. Bounds and order of arrays must match that used to call initialize. quality may be null if dataset does not support quality.
        Specified by:
        write in interface StreamingDatasetWriter
      • finishWithError

        public void finishWithError​(java.lang.Exception e)
        Description copied from interface: StreamingDatasetWriter
        Finishes the stream while indicating an error occurred. Either this, or the successful finish(), must be called.
        Specified by:
        finishWithError in interface StreamingDatasetWriter
      • getRowCount

        public int getRowCount()
        Description copied from interface: Dataset
        Return the number of rows in this dataset
        Specified by:
        getRowCount in interface Dataset
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int col)
        Description copied from interface: Dataset
        Returns the value in the dataset at the given location.
        Specified by:
        getValueAt in interface Dataset
      • printToConsole

        public void printToConsole()