Berkeley DB
version 4.2.52

com.sleepycat.db
Class DbException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sleepycat.db.DbException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DbDeadlockException, DbLockNotGrantedException, DbMemoryException, DbRunRecoveryException

public class DbException
extends Exception

This information describes the DbException class and how it is used by the various Berkeley DB classes.

Most methods in the Berkeley DB classes throw an exception when an error occurs. A DbException object contains an informational string, an errno, and a reference to the environment from which the exception was thrown.

Some methods may return non-zero 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, Db.get returns Db.DB_NOTFOUND when a requested key does not appear in the database.

See Also:
Serialized Form

Constructor Summary
DbException(String s)
          The DbException constructor returns an instance of the DbException class containing the string.
DbException(String s, int errno)
          The DbException constructor returns an instance of the DbException class containing the string and the encapsulated errno.
DbException(String s, int errno, DbEnv dbenv)
          The DbException constructor returns an instance of the DbException class containing the string, the encapsulated errno, and the database environment.
 
Method Summary
 int get_errno()
          Deprecated. As of Berkeley DB 4.2, replaced by getErrno()
 DbEnv getDbEnv()
          The DbException.getDbEnv method returns the database environment.
 int getErrno()
          The DbException.getErrno method returns the error value.
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbException

public DbException(String s)
The DbException constructor returns an instance of the DbException class containing the string.

Parameters:
s - specifies a message describing the exception.

DbException

public DbException(String s,
                   int errno)
The DbException constructor returns an instance of the DbException class containing the string and the encapsulated errno.

Parameters:
s - specifies a message describing the exception.
errno - specifies an error code.

DbException

public DbException(String s,
                   int errno,
                   DbEnv dbenv)
The DbException constructor returns an instance of the DbException class containing the string, the encapsulated errno, and the database environment.

Parameters:
s - specifies a message describing the exception.
errno - specifies an error code.
dbenv - the database environment where the exception occurred.
Method Detail

getDbEnv

public DbEnv getDbEnv()
The DbException.getDbEnv method returns the database environment.

Returns:
The DbException.getDbEnv method returns the database environment.


getErrno

public int getErrno()
The DbException.getErrno method returns the error value.

Returns:
The DbException.getErrno method returns the error value.


get_errno

public int get_errno()
Deprecated. As of Berkeley DB 4.2, replaced by getErrno()

Returns:
Description of the Return Value

toString

public String toString()
Overrides:
toString in class Throwable
Returns:
Description of the Return Value

Berkeley DB
version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.