public class DatabaseException
extends java.lang.Exception
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.
Constructor and 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.
|
Modifier and Type | Method and 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() |
public DatabaseException(java.lang.Throwable t)
t
- the causepublic DatabaseException(java.lang.String s)
s
- the messagepublic DatabaseException(java.lang.String s, int errno)
s
- the messageerrno
- the error numberpublic DatabaseException(java.lang.String s, int errno, Environment dbenv)
s
- the messageerrno
- the error numberdbenv
- the database environment handlepublic Environment getEnvironment()
This method may be called at any time during the life of the application.
public int getErrno()
Note that error numbers can be returned from system calls and are system-specific.
public java.lang.String toString()
toString
in class java.lang.Throwable
Copyright (c) 1996, 2019 Oracle and/or its affiliates. All rights reserved.