Class BatchCompletion


  • public final class BatchCompletion
    extends java.lang.Object
    Completion data from a batch execute.
    Since:
    5
    Author:
    Mark Rotteveel
    • Constructor Detail

      • BatchCompletion

        public BatchCompletion​(int elementCount,
                               int[] updateCounts,
                               java.util.List<BatchCompletion.DetailedError> detailedErrors,
                               int[] simplifiedErrors)
    • Method Detail

      • elementCount

        public int elementCount()
        Returns:
        number of elements (batch row values) processed by the server.
      • updateCounts

        public int[] updateCounts()
        Update counts per element.

        Reports either the update count, -1 (BatchItems.BATCH_EXECUTE_FAILED if the element resulted in an error (NOTE: JDBC uses -3 (Statement.EXECUTE_FAILED!), or -2 (BatchItems.BATCH_SUCCESS_NO_INFO) for success without update count (equivalent to Statement.SUCCESS_NO_INFO).

        The array is empty if TAG_RECORD_COUNTS was not requested.

        Note that contrary to JDBC, if TAG_MULTIERROR is not requested, the last update count will be -1 for the failed record (JDBC expects the update counts to end before the first failure).

        Returns:
        update counts
      • detailedErrors

        public java.util.List<BatchCompletion.DetailedError> detailedErrors()
        Detailed errors per failed element, reporting the failed element number and SQLException.

        Will have at most 1 error if TAG_MULTIERROR is not requested.

        By default, at most 64 detailed errors will be reported (at most 256 can be requested with TAG_DETAILED_ERRORS). The remaining errors will be reported in simplifiedErrors. The limits and defaults mentioned are as of Firebird 4 and not enforced by Jaybird.

        Returns:
        detailed errors
      • simplifiedErrors

        public int[] simplifiedErrors()
        Simplified errors, reports failed element number, when error count exceeds the maximum detailed errors.
        Returns:
        rows with errors without detailed error information
      • hasErrors

        public boolean hasErrors()
        Returns:
        true if there are any errors, false otherwise