Class DatabaseException

    • Constructor Detail

      • DatabaseException

        public DatabaseException​(String message)
        Constructs a new DatabaseException instance
        Parameters:
        message - the exception message
      • DatabaseException

        public DatabaseException​(String message,
                                 String statement)
        Constructs a new DatabaseException instance
        Parameters:
        message - the exception message
        statement - the sql statement which caused the exception
      • DatabaseException

        public DatabaseException​(SQLException cause)
        Constructs a new DatabaseException instance
        Parameters:
        cause - the root cause, the stack trace is copied and used
      • DatabaseException

        public DatabaseException​(SQLException cause,
                                 String message)
        Constructs a new DatabaseException instance
        Parameters:
        cause - the root cause, the stack trace is copied and used
        message - the exception message
      • DatabaseException

        public DatabaseException​(SQLException cause,
                                 String message,
                                 String statement)
        Constructs a new DatabaseException instance
        Parameters:
        cause - the root cause, the stack trace is copied and used
        message - the exception message
        statement - the sql statement which caused the exception
    • Method Detail

      • statement

        public final String statement()
        Returns the sql statement causing this exception, if available, note that this is only available when running with a local database connection.
        Returns:
        the sql query which caused the exception, null if not applicable
      • errorCode

        public final int errorCode()
        Returns the underlying error code, note that this is only available when running with a local database connection.
        Returns:
        the underlying error code, -1 if not available