1<!--$Id: db_get_type.so,v 10.28 2007/09/21 20:06:01 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: Db::get_type</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>Db::get_type</b> 14</td> 15<td align=right> 16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25Db::get_type(DBTYPE *type); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: Db::get_type</b> 29<p>The Db::get_type method returns the type of the underlying access 30method (and file format). The type value is one of DB_BTREE, DB_HASH, 31DB_RECNO, or DB_QUEUE. This value may be used to determine the type of 32the database after a return from <a href="/api_cxx/db_open.html">Db::open</a> with the <b>type</b> 33parameter set to DB_UNKNOWN.</p> 34<p>The Db::get_type method may not be called before the <a href="/api_cxx/db_open.html">Db::open</a> method is called.</p> 35<p>The Db::get_type method 36either returns a non-zero error value 37or throws an exception that encapsulates a non-zero error value on 38failure, and returns 0 on success. 39</p> 40<b>Parameters</b> <br> 41 <b>type</b><ul compact><li>The <b>type</b> parameter references memory into which 42 the type of the underlying access method is copied.</ul> 43<br> 44<br><b>Errors</b> 45<p>The Db::get_type method 46may fail and throw 47<a href="/api_cxx/except_class.html">DbException</a>, 48encapsulating one of the following non-zero errors, or return one of 49the following non-zero errors:</p> 50<br> 51<b>EINVAL</b><ul compact><li>If the method was called before <a href="/api_cxx/db_open.html">Db::open</a> was called; or if an 52invalid flag value or parameter was specified.</ul> 53<br> 54<hr size=1 noshade> 55<br><b>Class</b> 56<a href="/api_cxx/db_class.html">Db</a> 57<br><b>See Also</b> 58<a href="/api_cxx/db_list.html">Databases and Related Methods</a> 59</tt> 60<table width="100%"><tr><td><br></td><td align=right> 61<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 62</td></tr></table> 63<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 64</body> 65</html> 66