Package com.sleepycat.db

## Class DatabaseException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.sleepycat.db.DatabaseException

- All Implemented Interfaces:
    `java.io.Serializable`
  Direct Known Subclasses:
    `DeadlockException`, `HeapFullException`, `IndexNotAvailableException`, `MemoryException`, `MetaCheckSumFailException`, `ReplicationDuplicateMasterException`, `ReplicationHandleDeadException`, `ReplicationHoldElectionException`, `ReplicationJoinFailureException`, `ReplicationLeaseExpiredException`, `ReplicationLockoutException`, `ReplicationSiteUnavailableException`, `RunRecoveryException`, `SliceCorruptException`, `StoreExistsException`, `StoreNotFoundException`, `VersionMismatchException`

      public class DatabaseException
      extends java.lang.Exception

  The root of all database exceptions.

  Note that in some cases, certain methods return status values without issuing an exception. This occurs in situations that are not normally considered an error, but when some informational status is returned. For example, `Database.get` returns `OperationStatus.NOTFOUND` when a requested key does not appear in the database.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DatabaseException​(java.lang.String s)` | Construct an exception with the specified message.
    `DatabaseException​(java.lang.String s, int errno)` | Construct an exception with the specified message and error number.
    `DatabaseException​(java.lang.String s, int errno, Environment dbenv)` | Construct an exception with the specified message and error number associated with a database environment handle.
    `DatabaseException​(java.lang.Throwable t)` | Construct an exception with the specified cause exception.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Environment` | `getEnvironment()` | Return the environment in which the exception occurred.
    `int` | `getErrno()` | Get the error number associated with this exception.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DatabaseException

          public DatabaseException​(java.lang.Throwable t)

      Construct an exception with the specified cause exception.
      Parameters:
        `t` - the cause

    - #### DatabaseException

          public DatabaseException​(java.lang.String s)

      Construct an exception with the specified message.
      Parameters:
        `s` - the message

    - #### DatabaseException

          public DatabaseException​(java.lang.String s,
                                   int errno)

      Construct an exception with the specified message and error number.
      Parameters:
        `s` - the message
        `errno` - the error number

    - #### DatabaseException

          public DatabaseException​(java.lang.String s,
                                   int errno,
                                   Environment dbenv)

      Construct an exception with the specified message and error number associated with a database environment handle.
      Parameters:
        `s` - the message
        `errno` - the error number
        `dbenv` - the database environment handle

  - ### Method Detail

    - #### getEnvironment

          public Environment getEnvironment()

      Return the environment in which the exception occurred.

      This method may be called at any time during the life of the application.

      Returns:
        The environment in which the exception occurred.

    - #### getErrno

          public int getErrno()

      Get the error number associated with this exception.

      Note that error numbers can be returned from system calls and are system-specific.

      Returns:
        the error number

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Throwable`

Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.