Class SqlException

All Implemented Interfaces:
Serializable, Iterable<Throwable>

public class SqlException extends SQLException
Wraps SQLExceptions and holds SQL statement.
Author:
Ralf Wisser
See Also:
  • Field Details

    • message

      public final String message
    • errorDialogTitle

      public final String errorDialogTitle
    • sqlStatement

      public final String sqlStatement
  • Constructor Details

    • SqlException

      public SqlException(String message, String sqlStatement, Throwable t)
      Constructor.
      Parameters:
      message - the error message
      sqlStatement - the SQL statement that caused the exception
      t - the cause
    • SqlException

      public SqlException(String message, String sqlStatement, Throwable t, String sqlLState)
      Constructor.
      Parameters:
      message - the error message
      sqlStatement - the SQL statement that caused the exception
      t - the cause
      sqlLState - the SQL state string
    • SqlException

      public SqlException(String errorDialogTitle, String message, String sqlStatement, Throwable t)
      Constructor.
      Parameters:
      errorDialogTitle - the title for the error dialog, or null
      message - the error message
      sqlStatement - the SQL statement that caused the exception
      t - the cause
    • SqlException

      public SqlException(String errorDialogTitle, String message, String sqlStatement, Throwable t, String sqlState)
      Constructor.
      Parameters:
      errorDialogTitle - the title for the error dialog, or null
      message - the error message
      sqlStatement - the SQL statement that caused the exception
      t - the cause
      sqlState - the SQL state string
  • Method Details

    • isFormatted

      public boolean isFormatted()
      Returns whether the error message is already formatted for display.
      Returns:
      true if the message is pre-formatted
    • setFormatted

      public void setFormatted(boolean isFormatted)
      Sets whether the error message is already formatted for display.
      Parameters:
      isFormatted - true if the message is pre-formatted
    • getSQLState

      public String getSQLState()
      Returns the SQL state associated with this exception. Returns the SQL state from the wrapped cause if available.
      Overrides:
      getSQLState in class SQLException
      Returns:
      the SQL state string, or null if unavailable