2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: Db</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
18
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
import com.sleepycat.db.*;
25
public class Db extends Object
27
Db(DbEnv dbenv, int flags)
33
<p>The Db handle is the handle for a Berkeley DB database, which may or
34
may not be part of a database environment. Db handles are
35
free-threaded if the <a href="../api_java/env_open.html#DB_THREAD">Db.DB_THREAD</a> flag is specified to the
36
<a href="../api_java/db_open.html">Db.open</a> method when the database is opened or if the database
37
environment in which the database is opened is free-threaded. The
38
handle should not be closed while any other handle that refers to the
39
database is in use; for example, database handles must not be closed
40
while cursor handles into the database remain open, or transactions that
41
include operations on the database have not yet been committed or
42
aborted. Once the <a href="../api_java/db_close.html">Db.close</a>, <a href="../api_java/db_remove.html">Db.remove</a>, or
43
<a href="../api_java/db_rename.html">Db.rename</a> methods are called, the handle may not be accessed again,
44
regardless of the method's return.
45
<p>The constructor creates a Db object that is the handle for a
46
Berkeley DB database. The constructor allocates memory internally; calling
47
the <a href="../api_java/db_close.html">Db.close</a>, <a href="../api_java/db_remove.html">Db.remove</a> or <a href="../api_java/db_rename.html">Db.rename</a> methods will
49
<p>If no <b>dbenv</b> value is specified, the database is standalone; that
50
is, it is not part of any Berkeley DB environment.
51
<p>If a <b>dbenv</b> value is specified, the database is created within
52
the specified Berkeley DB environment. The database access methods
53
automatically make calls to the other subsystems in Berkeley DB based on the
54
enclosing environment. For example, if the environment has been
55
configured to use locking, the access methods will automatically acquire
56
the correct locks when reading and writing pages of the database.
57
<p>The <b>flags</b> value must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one or
58
more of the following values:
60
<p><dt><a name="Db.DB_XA_CREATE">Db.DB_XA_CREATE</a><dd>Instead of creating a standalone database, create a database intended to
61
be accessed via applications running under a X/Open conformant Transaction
62
Manager. The database will be opened in the environment specified by the
63
OPENINFO parameter of the GROUPS section of the ubbconfig file. See the
64
<a href="../ref/xa/intro.html">XA Resource Manager</a> chapter in the
65
Reference Guide for more information.
70
<a href="../api_java/db_list.html">Databases and Related Methods</a>
72
<table width="100%"><tr><td><br></td><td align=right>
73
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
75
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>