db_class.html   [plain text]


<!--$Id: db_class.html,v 1.1 2003/02/15 04:55:50 zarzycki Exp $-->
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: Db</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td>
<h1>Db</h1>
</td>
<td align=right>
<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>
</td></tr></table>
<hr size=1 noshade>
<tt>
<h3><pre>
import com.sleepycat.db.*;
<p>
public class Db extends Object
{
	Db(DbEnv dbenv, int flags)
		throws DbException;
	...
}
</pre></h3>
<h1>Description</h1>
<p>The Db handle is the handle for a Berkeley DB database, which may or
may not be part of a database environment.  Db handles are
free-threaded if the <a href="../api_java/env_open.html#DB_THREAD">Db.DB_THREAD</a> flag is specified to the
<a href="../api_java/db_open.html">Db.open</a> method when the database is opened or if the database
environment in which the database is opened is free-threaded.  The
handle should not be closed while any other handle that refers to the
database is in use; for example, database handles must not be closed
while cursor handles into the database remain open, or transactions that
include operations on the database have not yet been committed or
aborted.  Once 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 are called, the handle may not be accessed again,
regardless of the method's return.
<p>The constructor creates a Db object that is the handle for a
Berkeley DB database.  The constructor allocates memory internally; calling
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
free that memory.
<p>If no <b>dbenv</b> value is specified, the database is standalone; that
is, it is not part of any Berkeley DB environment.
<p>If a <b>dbenv</b> 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, the access methods will automatically acquire
the correct locks when reading and writing pages of the database.
<p>The <b>flags</b> value must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one or
more of the following values:
<p><dl compact>
<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
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
<a href="../ref/xa/intro.html">XA Resource Manager</a> chapter in the
Reference Guide for more information.
</dl>
<h1>Class</h1>
Db
<h1>See Also</h1>
<a href="../api_java/db_list.html">Databases and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<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>
</td></tr></table>
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
</body>
</html>