db.html   [plain text]


<!--$Id: db.so,v 11.10 2006/04/24 17:26:34 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Release 3.0: the DB structure</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td>
<td align=right><a href="../upgrade.3.0/xa.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.0/dbinfo.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Release 3.0: the DB structure</b></p>
<p>The <a href="../../api_c/db_class.html">DB</a> structure is now opaque for applications in the Berkeley DB 3.0
release.  Accesses to any fields within that structure by the application
should be replaced with method calls.  The following example illustrates
this using the historic type structure field.  In the Berkeley DB 2.X releases,
applications could find the type of an underlying database using code
similar to the following:</p>
<blockquote><pre>DB *db;
DB_TYPE type;
<p>
	type = db-&gt;type;</pre></blockquote>
<p>in the Berkeley DB 3.X releases, this should be done using the
<a href="../../api_c/db_get_type.html">DB-&gt;get_type</a> method, as follows:</p>
<blockquote><pre>DB *db;
DB_TYPE type;
<p>
	type = db-&gt;get_type(db);</pre></blockquote>
<p>The following table lists the <a href="../../api_c/db_class.html">DB</a> fields previously used by
applications and the methods that should now be used to get or set them.</p>
<table border=1 align=center>
<tr><th><a href="../../api_c/db_class.html">DB</a> field</th><th>Berkeley DB 3.X method</th></tr>
<tr><td>byteswapped</td><td><a href="../../api_c/db_get_byteswapped.html">DB-&gt;get_byteswapped</a></td></tr>
<tr><td>db_errcall</td><td><a href="../../api_c/db_set_errcall.html">DB-&gt;set_errcall</a></td></tr>
<tr><td>db_errfile</td><td><a href="../../api_c/db_set_errfile.html">DB-&gt;set_errfile</a></td></tr>
<tr><td>db_errpfx</td><td><a href="../../api_c/db_set_errpfx.html">DB-&gt;set_errpfx</a></td></tr>
<tr><td>db_paniccall</td><td>DB-&gt;set_paniccall</td></tr>
<tr><td>type</td><td><a href="../../api_c/db_get_type.html">DB-&gt;get_type</a></td></tr>
</table>
<table width="100%"><tr><td><br></td><td align=right><a href="../upgrade.3.0/xa.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.0/dbinfo.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>