# Db |

`

###

    #include <db_cxx.h>

    class Db {
    public:
    	Db(DbEnv *dbenv, u_int32_t flags);
    	~Db();
    	...
    };

# Description

This manual page describes the specific details of the Db class, which is the center of access method activity.

If no dbenv value is specified, the database is standalone, i.e., it is not part of any Berkeley DB environment.

If a dbenv value is specified, the database is created within the specified Berkeley DB environment. The database access methods automatically make calls to the other subsystems in Berkeley DB based on the enclosing environment. For example, if the environment has been configured to use locking, then the access methods will automatically acquire the correct locks when reading and writing pages of the database.

The flags value must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values.

DB_CXX_NO_EXCEPTIONS
  The Berkeley DB C++ API supports two different error behaviors. By default, whenever an error occurs an exception is thrown that encapsulates the error information. This generally allows for cleaner logic for transaction processing, as a try block can surround a single transaction. However, if DB_CXX_NO_EXCEPTIONS is specified, exceptions are not thrown, instead each individual function returns an error code.

  If dbenv is not null, this flag is ignored and the error behavior of the specified environment is used instead.

DB_XA_CREATE
  Instead of creating a standalone database, create a database intended to be accessed via applications running under a X/Open conformant Transaction Manager. The database will be opened in the environment specified by the OPENINFO parameter of the GROUPS section of the ubbconfig file. See the XA Resource Manager chapter in the Reference Guide for more information.

### Class

Db

# See Also

Db::close, Db::cursor, Db::del, Db::err, Db::fd, Db::get, Db::get_byteswapped, Db::get_type, Db::join, Db::key_range, Db::open, Db::put, Db::remove, Db::set_bt_compare, Db::set_bt_minkey, Db::set_bt_prefix, Db::set_cachesize, Db::set_dup_compare, Db::set_errcall, Db::set_errfile, Db::set_errpfx, Db::set_flags, Db::set_h_ffactor, Db::set_h_hash, Db::set_h_nelem, Db::set_lorder, Db::set_malloc, Db::set_pagesize, Db::set_paniccall, Db::set_realloc, Db::set_re_delim, Db::set_re_len, Db::set_re_pad, Db::set_re_source, Db::stat, Db::sync, Db::upgrade and Db::verify.`

Copyright Sleepycat Software