1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Db::get_type()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="db.html" title="Chapter 2. The Db Handle" /> 11 <link rel="prev" href="dbget_re_source.html" title="Db::get_re_source()" /> 12 <link rel="next" href="dbjoin.html" title="Db::join()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Db::get_type()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbget_re_source.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 2. 23 The Db Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="dbjoin.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbget_type"></a>Db::get_type()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41Db::get_type(DBTYPE *type);</pre> 42 <p> 43 The <code class="methodname">Db::get_type()</code> method returns the type of the underlying access 44 method (and file format). The type value is one of DB_BTREE, DB_HASH, 45 DB_RECNO, or DB_QUEUE. This value may be used to determine the type 46 of the database after a return from <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 47 with the <span class="bold"><strong>type</strong></span> parameter set to DB_UNKNOWN. 48 </p> 49 <p> 50 The <code class="methodname">Db::get_type()</code> method may not be called before the 51 <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called. 52 </p> 53 <p> 54 The <code class="methodname">Db::get_type()</code> <span> 55 56 <span> 57 method either returns a non-zero error value or throws an 58 exception that encapsulates a non-zero error value on 59 failure, and returns 0 on success. 60 </span> 61 </span> 62 </p> 63 <div class="sect2" lang="en" xml:lang="en"> 64 <div class="titlepage"> 65 <div> 66 <div> 67 <h3 class="title"><a id="id1638418"></a>Parameters</h3> 68 </div> 69 </div> 70 </div> 71 <div class="sect3" lang="en" xml:lang="en"> 72 <div class="titlepage"> 73 <div> 74 <div> 75 <h4 class="title"><a id="id1638440"></a>type</h4> 76 </div> 77 </div> 78 </div> 79 <p> 80 The <span class="bold"><strong>type</strong></span> parameter references memory 81 into which the type of the underlying access method is copied. 82 </p> 83 </div> 84 </div> 85 <div class="sect2" lang="en" xml:lang="en"> 86 <div class="titlepage"> 87 <div> 88 <div> 89 <h3 class="title"><a id="id1638538"></a>Errors</h3> 90 </div> 91 </div> 92 </div> 93 <p> 94 The <code class="methodname">Db::get_type()</code> <span> 95 96 <span> 97 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 98 exception, encapsulating one of the following non-zero errors, or return one 99 of the following non-zero errors: 100 </span> 101 </span> 102 </p> 103 <div class="sect3" lang="en" xml:lang="en"> 104 <div class="titlepage"> 105 <div> 106 <div> 107 <h4 class="title"><a id="id1638534"></a>EINVAL</h4> 108 </div> 109 </div> 110 </div> 111 <p> 112 If the method was called before <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> 113 was called; or if an invalid flag value or parameter was specified. 114 </p> 115 </div> 116 </div> 117 <div class="sect2" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h3 class="title"><a id="id1638419"></a>Class</h3> 122 </div> 123 </div> 124 </div> 125 <p> 126 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 127 </p> 128 </div> 129 <div class="sect2" lang="en" xml:lang="en"> 130 <div class="titlepage"> 131 <div> 132 <div> 133 <h3 class="title"><a id="id1638749"></a>See Also</h3> 134 </div> 135 </div> 136 </div> 137 <p> 138 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 139 </p> 140 </div> 141 </div> 142 <div class="navfooter"> 143 <hr /> 144 <table width="100%" summary="Navigation footer"> 145 <tr> 146 <td width="40%" align="left"><a accesskey="p" href="dbget_re_source.html">Prev</a> </td> 147 <td width="20%" align="center"> 148 <a accesskey="u" href="db.html">Up</a> 149 </td> 150 <td width="40%" align="right"> <a accesskey="n" href="dbjoin.html">Next</a></td> 151 </tr> 152 <tr> 153 <td width="40%" align="left" valign="top">Db::get_re_source() </td> 154 <td width="20%" align="center"> 155 <a accesskey="h" href="index.html">Home</a> 156 </td> 157 <td width="40%" align="right" valign="top"> Db::join()</td> 158 </tr> 159 </table> 160 </div> 161 </body> 162</html> 163