Interface IProgressReporter

All Superinterfaces:
AutoCloseable

public interface IProgressReporter extends AutoCloseable
Interface for reporting progress, warnings, errors, and query results during database operations.

Implementations of this interface are used to provide feedback during potentially long-running database operations. The interface extends AutoCloseable to ensure proper resource cleanup.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Closes the progress reporter by calling terminate().
    void
    reportErrorLocation(int start, int length)
    Reports the location of an error within a SQL statement.
    void
    showData(String query, List<List<Object>> object)
    Displays query results in the progress report.
    void
    Terminates the progress reporting session.
    void
    Writes the current database name being processed to the progress report.
    void
    writeError(String message)
    Writes an error message to the progress report.
    void
    Writes an informational message to the progress report.
    void
    Writes a warning message to the progress report.
  • Method Details

    • writeDbName

      void writeDbName()
      Writes the current database name being processed to the progress report.
    • writeMessage

      void writeMessage(String message)
      Writes an informational message to the progress report.
      Parameters:
      message - the informational message to display
    • writeWarning

      void writeWarning(String message)
      Writes a warning message to the progress report.
      Parameters:
      message - the warning message to display
    • writeError

      void writeError(String message)
      Writes an error message to the progress report.
      Parameters:
      message - the error message to display
    • terminate

      void terminate()
      Terminates the progress reporting session.
    • showData

      void showData(String query, List<List<Object>> object)
      Displays query results in the progress report.
      Parameters:
      query - the SQL query that was executed
      object - the result set data to display (as rows of objects)
    • reportErrorLocation

      void reportErrorLocation(int start, int length)
      Reports the location of an error within a SQL statement.
      Parameters:
      start - the starting position of the error in the SQL text
      length - the length of the erroneous section
    • close

      default void close()
      Closes the progress reporter by calling terminate().

      This default implementation ensures the reporter is properly terminated when used in try-with-resources blocks.

      Specified by:
      close in interface AutoCloseable