1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.5.0) on Thu May 15 17:17:32 EDT 2008 -->
6<TITLE>
7SecondaryDatabase (Oracle - Berkeley DB Java API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="com.sleepycat.db.SecondaryDatabase class">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    parent.document.title="SecondaryDatabase (Oracle - Berkeley DB Java API)";
18}
19</SCRIPT>
20<NOSCRIPT>
21</NOSCRIPT>
22
23</HEAD>
24
25<BODY BGCOLOR="white" onload="windowTitle();">
26
27
28<!-- ========= START OF TOP NAVBAR ======= -->
29<A NAME="navbar_top"><!-- --></A>
30<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32<TR>
33<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34<A NAME="navbar_top_firstrow"><!-- --></A>
35<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36  <TR ALIGN="center" VALIGN="top">
37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SecondaryDatabase.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
45  </TR>
46</TABLE>
47</TD>
48<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
49<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM>
50</TD>
51</TR>
52
53<TR>
54<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
55&nbsp;<A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
56&nbsp;<A HREF="/com/sleepycat/db/SecondaryKeyCreator.html" title="interface in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58  <A HREF="/index.html?com/sleepycat/db/SecondaryDatabase.html" target="_top"><B>FRAMES</B></A>  &nbsp;
59&nbsp;<A HREF="SecondaryDatabase.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
60&nbsp;<SCRIPT type="text/javascript">
61  <!--
62  if(window==top) {
63    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
64  }
65  //-->
66</SCRIPT>
67<NOSCRIPT>
68  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
69</NOSCRIPT>
70
71
72</FONT></TD>
73</TR>
74<TR>
75<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
76  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
78DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
79</TR>
80</TABLE>
81<A NAME="skip-navbar_top"></A>
82<!-- ========= END OF TOP NAVBAR ========= -->
83
84<HR>
85<!-- ======== START OF CLASS DATA ======== -->
86<H2>
87<FONT SIZE="-1">
88com.sleepycat.db</FONT>
89<BR>
90Class SecondaryDatabase</H2>
91<PRE>
92<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
93  <IMG SRC="/resources/inherit.gif" ALT="extended by "><A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">com.sleepycat.db.Database</A>
94      <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.SecondaryDatabase</B>
95</PRE>
96<HR>
97<DL>
98<DT><PRE>public class <B>SecondaryDatabase</B><DT>extends <A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></DL>
99</PRE>
100
101<P>
102A secondary database handle.
103<p>
104Secondary databases are opened with <A HREF="/com/sleepycat/db/Environment.html#openSecondaryDatabase(com.sleepycat.db.Transaction, java.lang.String, java.lang.String, com.sleepycat.db.Database, com.sleepycat.db.SecondaryConfig)"><CODE>Environment.openSecondaryDatabase</CODE></A> and are
105always associated with a single primary database.  The distinguishing
106characteristics of a secondary database are:
107<ul>
108<li>Records are automatically added to a secondary database when records are
109added, modified and deleted in the primary database.  Direct calls to
110<code>put()</code> methods on a secondary database are prohibited.</li>
111<li>The <A HREF="/com/sleepycat/db/Database.html#delete(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)"><CODE>delete</CODE></A> method of a secondary database will delete
112the primary record and as well as all its associated secondary records.</li>
113<li>Calls to all <code>get()</code> methods will return the data from the
114associated primary database.</li>
115<li>Additional <code>get()</code> method signatures are provided to return
116the primary key in an additional <code>pKey</code> parameter.</li>
117<li>Calls to <A HREF="/com/sleepycat/db/SecondaryDatabase.html#openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><CODE>openCursor</CODE></A> will return a <A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db"><CODE>SecondaryCursor</CODE></A>, which itself has <code>get()</code> methods that return
118the data of the primary database and additional <code>get()</code> method
119signatures for returning the primary key.</li>
120<li>The <A HREF="/com/sleepycat/db/SecondaryDatabase.html#openSecondaryCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><CODE>openSecondaryCursor</CODE></A> method is provided
121to return a <A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db"><CODE>SecondaryCursor</CODE></A> that doesn't require casting.</li>
122</ul>
123<p>
124Before opening or creating a secondary database you must implement the <A HREF="/com/sleepycat/db/SecondaryKeyCreator.html" title="interface in com.sleepycat.db"><CODE>SecondaryKeyCreator</CODE></A>
125interface.
126<p>
127For example, to create a secondary database that supports duplicates:
128<pre>
129    Database primaryDb; // The primary database must already be open.
130    SecondaryKeyCreator keyCreator; // Your key creator implementation.
131    SecondaryConfig secConfig = new SecondaryConfig();
132    secConfig.setAllowCreate(true);
133    secConfig.setSortedDuplicates(true);
134    secConfig.setKeyCreator(keyCreator);
135    SecondaryDatabase newDb = env.openSecondaryDatabase(transaction,
136                                                        "myDatabaseName",
137                                                        primaryDb,
138                                                        secConfig)
139</pre>
140<p>
141If a primary database is to be associated with one or more secondary
142databases, it may not be configured for duplicates.
143<p>
144Note that the associations between primary and secondary databases are not
145stored persistently.  Whenever a primary database is opened for write access by
146the application, the appropriate associated secondary databases should also be
147opened by the application.  This is necessary to ensure data integrity when
148changes are made to the primary database.
149<P>
150
151<P>
152<HR>
153
154<P>
155
156<!-- ======== CONSTRUCTOR SUMMARY ======== -->
157
158<A NAME="constructor_summary"><!-- --></A>
159<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
160<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
161<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
162<B>Constructor Summary</B></FONT></TH>
163</TR>
164<TR BGCOLOR="white" CLASS="TableRowColor">
165<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#SecondaryDatabase(java.lang.String, java.lang.String, com.sleepycat.db.Database, com.sleepycat.db.SecondaryConfig)">SecondaryDatabase</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;fileName,
166                  <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;databaseName,
167                  <A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A>&nbsp;primaryDatabase,
168                  <A HREF="/com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A>&nbsp;config)</CODE>
169
170<BR>
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a database.</TD>
172</TR>
173</TABLE>
174&nbsp;
175<!-- ========== METHOD SUMMARY =========== -->
176
177<A NAME="method_summary"><!-- --></A>
178<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
179<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
180<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
181<B>Method Summary</B></FONT></TH>
182</TR>
183<TR BGCOLOR="white" CLASS="TableRowColor">
184<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
185<CODE>&nbsp;<A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD>
186<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">get</A></B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
187    <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
188    <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
189    <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
190    <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)</CODE>
191
192<BR>
193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the key/data pair with the given key.</TD>
194</TR>
195<TR BGCOLOR="white" CLASS="TableRowColor">
196<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
197<CODE>&nbsp;<A HREF="/com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A></CODE></FONT></TD>
198<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#getConfig()">getConfig</A></B>()</CODE>
199
200<BR>
201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return this Database object's configuration.</TD>
202</TR>
203<TR BGCOLOR="white" CLASS="TableRowColor">
204<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
205<CODE>&nbsp;<A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></FONT></TD>
206<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#getPrimaryDatabase()">getPrimaryDatabase</A></B>()</CODE>
207
208<BR>
209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the primary database associated with this secondary database.</TD>
210</TR>
211<TR BGCOLOR="white" CLASS="TableRowColor">
212<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
213<CODE>&nbsp;<A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD>
214<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#getSearchBoth(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">getSearchBoth</A></B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
215              <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
216              <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
217              <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
218              <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)</CODE>
219
220<BR>
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the key/data pair with the specified secondary and primary key, that
222is, both the primary and secondary key items must match.</TD>
223</TR>
224<TR BGCOLOR="white" CLASS="TableRowColor">
225<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
226<CODE>&nbsp;<A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD>
227<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#getSearchRecordNumber(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">getSearchRecordNumber</A></B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
228                      <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
229                      <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
230                      <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
231                      <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)</CODE>
232
233<BR>
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the key/data pair associated with the specific numbered record of the database.</TD>
235</TR>
236<TR BGCOLOR="white" CLASS="TableRowColor">
237<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
238<CODE>&nbsp;<A HREF="/com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A></CODE></FONT></TD>
239<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#getSecondaryConfig()">getSecondaryConfig</A></B>()</CODE>
240
241<BR>
242&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a copy of the secondary configuration of this database.</TD>
243</TR>
244<TR BGCOLOR="white" CLASS="TableRowColor">
245<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
246<CODE>&nbsp;<A HREF="/com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db">Cursor</A></CODE></FONT></TD>
247<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">openCursor</A></B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
248           <A HREF="/com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A>&nbsp;config)</CODE>
249
250<BR>
251&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a cursor into the database.</TD>
252</TR>
253<TR BGCOLOR="white" CLASS="TableRowColor">
254<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
255<CODE>&nbsp;<A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db">SecondaryCursor</A></CODE></FONT></TD>
256<TD><CODE><B><A HREF="/com/sleepycat/db/SecondaryDatabase.html#openSecondaryCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">openSecondaryCursor</A></B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
257                    <A HREF="/com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A>&nbsp;config)</CODE>
258
259<BR>
260&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obtain a cursor on a database, returning a <code>SecondaryCursor</code>.</TD>
261</TR>
262</TABLE>
263&nbsp;<A NAME="methods_inherited_from_class_com.sleepycat.db.Database"><!-- --></A>
264<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
265<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
266<TH ALIGN="left"><B>Methods inherited from class com.sleepycat.db.<A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></B></TH>
267</TR>
268<TR BGCOLOR="white" CLASS="TableRowColor">
269<TD><CODE><A HREF="/com/sleepycat/db/Database.html#append(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">append</A>, <A HREF="/com/sleepycat/db/Database.html#close()">close</A>, <A HREF="/com/sleepycat/db/Database.html#close(boolean)">close</A>, <A HREF="/com/sleepycat/db/Database.html#compact(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.CompactConfig)">compact</A>, <A HREF="/com/sleepycat/db/Database.html#consume(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, boolean)">consume</A>, <A HREF="/com/sleepycat/db/Database.html#delete(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">delete</A>, <A HREF="/com/sleepycat/db/Database.html#exists(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">exists</A>, <A HREF="/com/sleepycat/db/Database.html#get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">get</A>, <A HREF="/com/sleepycat/db/Database.html#getCacheFile()">getCacheFile</A>, <A HREF="/com/sleepycat/db/Database.html#getDatabaseFile()">getDatabaseFile</A>, <A HREF="/com/sleepycat/db/Database.html#getDatabaseName()">getDatabaseName</A>, <A HREF="/com/sleepycat/db/Database.html#getEnvironment()">getEnvironment</A>, <A HREF="/com/sleepycat/db/Database.html#getKeyRange(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">getKeyRange</A>, <A HREF="/com/sleepycat/db/Database.html#getSearchBoth(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">getSearchBoth</A>, <A HREF="/com/sleepycat/db/Database.html#getSearchRecordNumber(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)">getSearchRecordNumber</A>, <A HREF="/com/sleepycat/db/Database.html#getStats(com.sleepycat.db.Transaction, com.sleepycat.db.StatsConfig)">getStats</A>, <A HREF="/com/sleepycat/db/Database.html#join(com.sleepycat.db.Cursor[], com.sleepycat.db.JoinConfig)">join</A>, <A HREF="/com/sleepycat/db/Database.html#openSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)">openSequence</A>, <A HREF="/com/sleepycat/db/Database.html#put(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">put</A>, <A HREF="/com/sleepycat/db/Database.html#putNoDupData(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">putNoDupData</A>, <A HREF="/com/sleepycat/db/Database.html#putNoOverwrite(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">putNoOverwrite</A>, <A HREF="/com/sleepycat/db/Database.html#remove(java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)">remove</A>, <A HREF="/com/sleepycat/db/Database.html#removeSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)">removeSequence</A>, <A HREF="/com/sleepycat/db/Database.html#rename(java.lang.String, java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)">rename</A>, <A HREF="/com/sleepycat/db/Database.html#setConfig(com.sleepycat.db.DatabaseConfig)">setConfig</A>, <A HREF="/com/sleepycat/db/Database.html#sync()">sync</A>, <A HREF="/com/sleepycat/db/Database.html#truncate(com.sleepycat.db.Transaction, boolean)">truncate</A>, <A HREF="/com/sleepycat/db/Database.html#upgrade(java.lang.String, com.sleepycat.db.DatabaseConfig)">upgrade</A>, <A HREF="/com/sleepycat/db/Database.html#verify(java.lang.String, java.lang.String, java.io.PrintStream, com.sleepycat.db.VerifyConfig, com.sleepycat.db.DatabaseConfig)">verify</A></CODE></TD>
270</TR>
271</TABLE>
272&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
273<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
274<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
275<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH>
276</TR>
277<TR BGCOLOR="white" CLASS="TableRowColor">
278<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
279</TR>
280</TABLE>
281&nbsp;
282<P>
283
284<!-- ========= CONSTRUCTOR DETAIL ======== -->
285
286<A NAME="constructor_detail"><!-- --></A>
287<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
288<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
289<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
290<B>Constructor Detail</B></FONT></TH>
291</TR>
292</TABLE>
293
294<A NAME="SecondaryDatabase(java.lang.String, java.lang.String, com.sleepycat.db.Database, com.sleepycat.db.SecondaryConfig)"><!-- --></A><H3>
295SecondaryDatabase</H3>
296<PRE>
297public <B>SecondaryDatabase</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;fileName,
298                         <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;databaseName,
299                         <A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A>&nbsp;primaryDatabase,
300                         <A HREF="/com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A>&nbsp;config)
301                  throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>,
302                         <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></PRE>
303<DL>
304<DD>Open a database.
305<p>
306The database is represented by the file and database parameters.
307<p>
308The currently supported database file formats (or <em>access
309methods</em>) are Btree, Hash, Queue, and Recno.  The Btree format is a
310representation of a sorted, balanced tree structure.  The Hash format
311is an extensible, dynamic hashing scheme.  The Queue format supports
312fast access to fixed-length records accessed sequentially or by logical
313record number.  The Recno format supports fixed- or variable-length
314records, accessed sequentially or by logical record number, and
315optionally backed by a flat text file.
316<p>
317Storage and retrieval are based on key/data pairs; see <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A>
318for more information.
319<p>
320Opening a database is a relatively expensive operation, and maintaining
321a set of open databases will normally be preferable to repeatedly
322opening and closing the database for each new query.
323<p>
324In-memory databases never intended to be preserved on disk may be
325created by setting both the fileName and databaseName parameters to
326null.  Note that in-memory databases can only ever be shared by sharing
327the single database handle that created them, in circumstances where
328doing so is safe.  The environment variable <code>TMPDIR</code> may
329be used as a directory in which to create temporary backing files.
330<p>
331<P>
332<DL>
333<DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The name of an underlying file that will be used to back the database.
334On Windows platforms, this argument will be interpreted as a UTF-8
335string, which is equivalent to ASCII for Latin characters.
336<p><DD><CODE>databaseName</CODE> - An optional parameter that allows applications to have multiple
337databases in a single file.  Although no databaseName parameter needs
338to be specified, it is an error to attempt to open a second database in
339a physical file that was not initially created using a databaseName
340parameter.  Further, the databaseName parameter is not supported by the
341Queue format.
342<p><DD><CODE>primaryDatabase</CODE> - a database handle for the primary database that is to be indexed.
343<p><DD><CODE>config</CODE> - The secondary database open attributes.  If null, default attributes are used.
344<DT><B>Throws:</B>
345<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE>
346<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileNotFoundException.html" title="class or interface in java.io">FileNotFoundException</A></CODE></DL>
347</DL>
348
349<!-- ============ METHOD DETAIL ========== -->
350
351<A NAME="method_detail"><!-- --></A>
352<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
353<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
354<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
355<B>Method Detail</B></FONT></TH>
356</TR>
357</TABLE>
358
359<A NAME="openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3>
360openCursor</H3>
361<PRE>
362public <A HREF="/com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db">Cursor</A> <B>openCursor</B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
363                         <A HREF="/com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A>&nbsp;config)
364                  throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
365<DL>
366<DD>Return a cursor into the database.
367    <p>
368<P>
369<DD><DL>
370<DT><B>Overrides:</B><DD><CODE><A HREF="/com/sleepycat/db/Database.html#openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">openCursor</A></CODE> in class <CODE><A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></DL>
371</DD>
372<DD><DL>
373<DT><B>Parameters:</B><DD><CODE>txn</CODE> - To use a cursor for writing to a transactional database, an explicit
374    transaction must be specified.  For read-only access to a transactional
375    database, the transaction may be null.  For a non-transactional database,
376    the transaction must be null.
377    <p>
378    To transaction-protect cursor operations, cursors must be opened and closed
379    within the context of a transaction, and the txn parameter specifies the
380    transaction context in which the cursor will be used.
381    <p><DD><CODE>config</CODE> - The cursor attributes.  If null, default attributes are used.
382    <p>
383<DT><B>Returns:</B><DD>A database cursor.
384    <p>
385<DT><B>Throws:</B>
386<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
387</DD>
388</DL>
389<HR>
390
391<A NAME="openSecondaryCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3>
392openSecondaryCursor</H3>
393<PRE>
394public <A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db">SecondaryCursor</A> <B>openSecondaryCursor</B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
395                                           <A HREF="/com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A>&nbsp;config)
396                                    throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
397<DL>
398<DD>Obtain a cursor on a database, returning a <code>SecondaryCursor</code>.
399    Calling this method is the equivalent of calling <A HREF="/com/sleepycat/db/SecondaryDatabase.html#openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><CODE>openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)</CODE></A> and
400    casting the result to <A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db"><CODE>SecondaryCursor</CODE></A>.
401    <p>
402<P>
403<DD><DL>
404<DT><B>Parameters:</B><DD><CODE>txn</CODE> - To use a cursor for writing to a transactional database, an explicit
405    transaction must be specified.  For read-only access to a transactional
406    database, the transaction may be null.  For a non-transactional database,
407    the transaction must be null.
408    <p>
409    To transaction-protect cursor operations, cursors must be opened and closed
410    within the context of a transaction, and the txn parameter specifies the
411    transaction context in which the cursor will be used.
412    <p><DD><CODE>config</CODE> - The cursor attributes.  If null, default attributes are used.
413    <p>
414<DT><B>Returns:</B><DD>A secondary database cursor.
415    <p>
416<DT><B>Throws:</B>
417<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
418</DD>
419</DL>
420<HR>
421
422<A NAME="getPrimaryDatabase()"><!-- --></A><H3>
423getPrimaryDatabase</H3>
424<PRE>
425public <A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> <B>getPrimaryDatabase</B>()</PRE>
426<DL>
427<DD>Returns the primary database associated with this secondary database.
428    <p>
429<P>
430<DD><DL>
431
432<DT><B>Returns:</B><DD>the primary database associated with this secondary database.</DL>
433</DD>
434</DL>
435<HR>
436
437<A NAME="getConfig()"><!-- --></A><H3>
438getConfig</H3>
439<PRE>
440public <A HREF="/com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> <B>getConfig</B>()
441                         throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
442<DL>
443<DD>Return this Database object's configuration.
444    <p>
445    This may differ from the configuration used to open this object if
446    the database existed previously.
447    <p>
448<P>
449<DD><DL>
450<DT><B>Overrides:</B><DD><CODE><A HREF="/com/sleepycat/db/Database.html#getConfig()">getConfig</A></CODE> in class <CODE><A HREF="/com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></DL>
451</DD>
452<DD><DL>
453
454<DT><B>Returns:</B><DD>This Database object's configuration.
455    <p>
456    <p>
457<DT><B>Throws:</B>
458<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
459</DD>
460</DL>
461<HR>
462
463<A NAME="getSecondaryConfig()"><!-- --></A><H3>
464getSecondaryConfig</H3>
465<PRE>
466public <A HREF="/com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A> <B>getSecondaryConfig</B>()
467                                   throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
468<DL>
469<DD>Returns a copy of the secondary configuration of this database.
470    <p>
471<P>
472<DD><DL>
473
474<DT><B>Returns:</B><DD>a copy of the secondary configuration of this database.
475    <p>
476    <p>
477<DT><B>Throws:</B>
478<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
479</DD>
480</DL>
481<HR>
482
483<A NAME="get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><!-- --></A><H3>
484get</H3>
485<PRE>
486public <A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>get</B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
487                           <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
488                           <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
489                           <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
490                           <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)
491                    throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
492<DL>
493<DD>Retrieves the key/data pair with the given key.  If the matching key has
494duplicate values, the first data item in the set of duplicates is returned.
495Retrieval of duplicates requires the use of <A HREF="/com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> operations.
496<p>
497<P>
498<DD><DL>
499<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified to
500transaction-protect the operation, or null may be specified to perform the
501operation without transaction protection.  For a non-transactional database,
502null must be specified.
503<p><DD><CODE>key</CODE> - the secondary key
504used as input.  It must be initialized with a non-null byte array by the
505caller.
506<p><DD><CODE>pKey</CODE> - the primary key
507returned as output.  Its byte array does not need to be initialized by the
508caller.
509<p><DD><CODE>data</CODE> - the primary data
510returned as output.  Its byte array does not need to be initialized by the
511caller.
512<p><DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used.
513<p>
514<DT><B>Returns:</B><DD><A HREF="/com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> if no matching key/data pair is
515found; <A HREF="/com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, <A HREF="/com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>.
516<p>
517<p>
518<DT><B>Throws:</B>
519<DD><CODE><A HREF="/com/sleepycat/db/DeadlockException.html" title="class in com.sleepycat.db">DeadlockException</A></CODE> - if the operation was selected to resolve a
520deadlock.
521<p>
522<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified.
523<p>
524<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
525</DD>
526</DL>
527<HR>
528
529<A NAME="getSearchBoth(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><!-- --></A><H3>
530getSearchBoth</H3>
531<PRE>
532public <A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>getSearchBoth</B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
533                                     <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
534                                     <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
535                                     <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
536                                     <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)
537                              throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
538<DL>
539<DD>Retrieves the key/data pair with the specified secondary and primary key, that
540is, both the primary and secondary key items must match.
541<p>
542<P>
543<DD><DL>
544<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified to
545transaction-protect the operation, or null may be specified to perform the
546operation without transaction protection.  For a non-transactional database,
547null must be specified.<DD><CODE>key</CODE> - the secondary key
548used as input.  It must be initialized with a non-null byte array by the
549caller.<DD><CODE>pKey</CODE> - the primary key
550used as input.  It must be initialized with a non-null byte array by the
551caller.<DD><CODE>data</CODE> - the primary data
552returned as output.  Its byte array does not need to be initialized by the
553caller.
554<p><DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used.
555<p>
556<DT><B>Returns:</B><DD><A HREF="/com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> if no matching key/data pair is
557found; <A HREF="/com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, <A HREF="/com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>.
558<p>
559<p>
560<DT><B>Throws:</B>
561<DD><CODE><A HREF="/com/sleepycat/db/DeadlockException.html" title="class in com.sleepycat.db">DeadlockException</A></CODE> - if the operation was selected to resolve a
562deadlock.
563<p>
564<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified.
565<p>
566<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL>
567</DD>
568</DL>
569<HR>
570
571<A NAME="getSearchRecordNumber(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><!-- --></A><H3>
572getSearchRecordNumber</H3>
573<PRE>
574public <A HREF="/com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>getSearchRecordNumber</B>(<A HREF="/com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
575                                             <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;key,
576                                             <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;pKey,
577                                             <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A>&nbsp;data,
578                                             <A HREF="/com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;lockMode)
579                                      throws <A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
580<DL>
581<DD>Retrieves the key/data pair associated with the specific numbered record of the database.
582<p>
583The data field of the specified key must be a byte array containing a
584record number, as described in <A HREF="/com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A>.  This determines
585the record to be retrieved.
586<p>
587For this method to be called, the underlying database must be of type
588Btree, and it must have been configured to support record numbers.
589<p>
590If this method fails for any reason, the position of the cursor will be
591unchanged.
592<P>
593<DD><DL>
594<DT><B>Parameters:</B><DD><CODE>key</CODE> - the secondary key
595returned as output.  Its byte array does not need to be initialized by the
596caller.<DD><CODE>pKey</CODE> - the primary key
597returned as output.  Its byte array does not need to be initialized by the
598caller.<DD><CODE>data</CODE> - the primary data
599returned as output.  Multiple results can be retrieved by passing an object
600that is a subclass of <A HREF="/com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A>, otherwise its byte array does not
601need to be initialized by the caller.<DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used.
602<DT><B>Returns:</B><DD><A HREF="/com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> if no matching key/data pair is
603found; <A HREF="/com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> if the database is a Queue or Recno database and the specified key exists, but was never explicitly created by the application or was later deleted; otherwise, <A HREF="/com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>.
604<DT><B>Throws:</B>
605<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if a DatabaseEntry parameter is null or
606does not contain a required non-null byte array.
607<p>
608<DD><CODE><A HREF="/com/sleepycat/db/DeadlockException.html" title="class in com.sleepycat.db">DeadlockException</A></CODE> - if the operation was selected to resolve a
609deadlock.
610<p>
611<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified.
612<p>
613<DD><CODE><A HREF="/com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.
614<p></DL>
615</DD>
616</DL>
617<!-- ========= END OF CLASS DATA ========= -->
618<HR>
619
620
621<!-- ======= START OF BOTTOM NAVBAR ====== -->
622<A NAME="navbar_bottom"><!-- --></A>
623<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
624<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
625<TR>
626<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
627<A NAME="navbar_bottom_firstrow"><!-- --></A>
628<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
629  <TR ALIGN="center" VALIGN="top">
630  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
631  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
632  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
633  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SecondaryDatabase.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
634  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
635  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
636  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
637  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
638  </TR>
639</TABLE>
640</TD>
641<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
642<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM>
643</TD>
644</TR>
645
646<TR>
647<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
648&nbsp;<A HREF="/com/sleepycat/db/SecondaryCursor.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
649&nbsp;<A HREF="/com/sleepycat/db/SecondaryKeyCreator.html" title="interface in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
650<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
651  <A HREF="/index.html?com/sleepycat/db/SecondaryDatabase.html" target="_top"><B>FRAMES</B></A>  &nbsp;
652&nbsp;<A HREF="SecondaryDatabase.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
653&nbsp;<SCRIPT type="text/javascript">
654  <!--
655  if(window==top) {
656    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
657  }
658  //-->
659</SCRIPT>
660<NOSCRIPT>
661  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
662</NOSCRIPT>
663
664
665</FONT></TD>
666</TR>
667<TR>
668<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
669  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
670<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
671DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
672</TR>
673</TABLE>
674<A NAME="skip-navbar_bottom"></A>
675<!-- ======== END OF BOTTOM NAVBAR ======= -->
676
677<HR>
678<font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
679</BODY>
680</HTML>
681