| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
|
| 3 |
<HTML> |
| 4 |
<HEAD> |
| 5 |
|
| 6 |
<TITLE> |
| 7 |
Database (Oracle - Berkeley DB Java API) |
| 8 |
</TITLE> |
| 9 |
|
| 10 |
<META NAME="date" CONTENT="2013-09-09"> |
| 11 |
|
| 12 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> |
| 13 |
|
| 14 |
<SCRIPT type="text/javascript"> |
| 15 |
function windowTitle() |
| 16 |
{ |
| 17 |
if (location.href.indexOf('is-external=true') == -1) { |
| 18 |
parent.document.title="Database (Oracle - Berkeley DB Java API)"; |
| 19 |
} |
| 20 |
} |
| 21 |
</SCRIPT> |
| 22 |
<NOSCRIPT> |
| 23 |
</NOSCRIPT> |
| 24 |
|
| 25 |
</HEAD> |
| 26 |
|
| 27 |
<BODY BGCOLOR="white" onload="windowTitle();"> |
| 28 |
<HR> |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
<A NAME="navbar_top"></A> |
| 33 |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| 34 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 35 |
<TR> |
| 36 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 37 |
<A NAME="navbar_top_firstrow"></A> |
| 38 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 39 |
<TR ALIGN="center" VALIGN="top"> |
| 40 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 41 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 42 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 43 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Database.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 44 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 45 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 46 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 47 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 48 |
</TR> |
| 49 |
</TABLE> |
| 50 |
</TD> |
| 51 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 52 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 53 |
</TD> |
| 54 |
</TR> |
| 55 |
|
| 56 |
<TR> |
| 57 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 58 |
<A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A> |
| 59 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> |
| 60 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 61 |
<A HREF="../../../index.html?com/sleepycat/db/Database.html" target="_top"><B>FRAMES</B></A> |
| 62 |
<A HREF="Database.html" target="_top"><B>NO FRAMES</B></A> |
| 63 |
<SCRIPT type="text/javascript"> |
| 64 |
<!-- |
| 65 |
if(window==top) { |
| 66 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 67 |
} |
| 68 |
//--> |
| 69 |
</SCRIPT> |
| 70 |
<NOSCRIPT> |
| 71 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 72 |
</NOSCRIPT> |
| 73 |
|
| 74 |
|
| 75 |
</FONT></TD> |
| 76 |
</TR> |
| 77 |
<TR> |
| 78 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 79 |
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 80 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 81 |
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 82 |
</TR> |
| 83 |
</TABLE> |
| 84 |
<A NAME="skip-navbar_top"></A> |
| 85 |
|
| 86 |
|
| 87 |
<HR> |
| 88 |
|
| 89 |
<H2> |
| 90 |
<FONT SIZE="-1"> |
| 91 |
com.sleepycat.db</FONT> |
| 92 |
<BR> |
| 93 |
Class Database</H2> |
| 94 |
<PRE> |
| 95 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
| 96 |
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.Database</B> |
| 97 |
</PRE> |
| 98 |
<DL> |
| 99 |
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/sleepycat/db/SecondaryDatabase.html" title="class in com.sleepycat.db">SecondaryDatabase</A></DD> |
| 100 |
</DL> |
| 101 |
<HR> |
| 102 |
<DL> |
| 103 |
<DT><PRE>public class <B>Database</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> |
| 104 |
</PRE> |
| 105 |
|
| 106 |
<P> |
| 107 |
Creates a database handle for a single Berkeley DB database. |
| 108 |
A Berkeley DB database provides a mechanism for organizing key-data pairs |
| 109 |
of information. From the perspective of some database systems, a Berkeley DB database |
| 110 |
could be thought of as a single table within a larger database. |
| 111 |
<p> |
| 112 |
For most database activities, you must open the handle using the |
| 113 |
open method. When you are done |
| 114 |
with them, handles must be closed using the close method. |
| 115 |
<p> |
| 116 |
It is possible to create databases such that they are organized within a |
| 117 |
database environment. Environments are optional for simple Berkeley DB applications |
| 118 |
that do not use transactions, recovery, replication or any other advanced features. |
| 119 |
For simple Berkeley DB applications, environments still offer some advantages. |
| 120 |
For example, they provide some organizational benefits on-disk (all databases |
| 121 |
are located on disk relative to the environment). Also, if you are using |
| 122 |
multiple databases, then environments allow your databases to share a |
| 123 |
common in-memory cache, which makes for more efficient usage of your hardware's resources. |
| 124 |
See <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db"><CODE>Environment</CODE></A> |
| 125 |
for information on using database environments. |
| 126 |
<p> |
| 127 |
Database handles are free-threaded unless opened in an environment |
| 128 |
that is not free-threaded. |
| 129 |
<p> |
| 130 |
Database attributes are specified in the <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><CODE>DatabaseConfig</CODE></A> class. |
| 131 |
<p> |
| 132 |
To open an existing database with default attributes: |
| 133 |
<blockquote><pre> |
| 134 |
Environment env = new Environment(home, null); |
| 135 |
Database myDatabase = env.openDatabase(null, "mydatabase", null); |
| 136 |
</pre></blockquote> |
| 137 |
To create a transactional database that supports duplicates: |
| 138 |
<blockquote><pre> |
| 139 |
DatabaseConfig dbConfig = new DatabaseConfig(); |
| 140 |
dbConfig.setTransactional(true); |
| 141 |
dbConfig.setAllowCreate(true); |
| 142 |
dbConfig.setSortedDuplicates(true); |
| 143 |
Database newlyCreateDb = env.openDatabase(txn, "mydatabase", dbConfig); |
| 144 |
</pre></blockquote> |
| 145 |
<P> |
| 146 |
|
| 147 |
<P> |
| 148 |
<HR> |
| 149 |
|
| 150 |
<P> |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
<A NAME="constructor_summary"></A> |
| 155 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 156 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 157 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| 158 |
<B>Constructor Summary</B></FONT></TH> |
| 159 |
</TR> |
| 160 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 161 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#Database(java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)">Database</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> filename, |
| 162 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 163 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config)</CODE> |
| 164 |
|
| 165 |
<BR> |
| 166 |
Open a database.</TD> |
| 167 |
</TR> |
| 168 |
</TABLE> |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
<A NAME="method_summary"></A> |
| 173 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 174 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 175 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| 176 |
<B>Method Summary</B></FONT></TH> |
| 177 |
</TR> |
| 178 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 179 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 180 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 181 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#append(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">append</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 182 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 183 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data)</CODE> |
| 184 |
|
| 185 |
<BR> |
| 186 |
|
| 187 |
Append the key/data pair to the end of the database.</TD> |
| 188 |
</TR> |
| 189 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 190 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 191 |
<CODE> void</CODE></FONT></TD> |
| 192 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#close()">close</A></B>()</CODE> |
| 193 |
|
| 194 |
<BR> |
| 195 |
Flush any cached database information to disk, close any open cursors, |
| 196 |
free allocated resources, close underlying files, and discard the database handle.</TD> |
| 197 |
</TR> |
| 198 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 199 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 200 |
<CODE> void</CODE></FONT></TD> |
| 201 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#close(boolean)">close</A></B>(boolean noSync)</CODE> |
| 202 |
|
| 203 |
<BR> |
| 204 |
Flush any cached database information to disk, close any open cursors, |
| 205 |
free allocated resources, close underlying files, and discard the database handle.</TD> |
| 206 |
</TR> |
| 207 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 208 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 209 |
<CODE> <A HREF="../../../com/sleepycat/db/CompactStats.html" title="class in com.sleepycat.db">CompactStats</A></CODE></FONT></TD> |
| 210 |
<TD><CODE><B><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></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 211 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> start, |
| 212 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> stop, |
| 213 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> end, |
| 214 |
<A HREF="../../../com/sleepycat/db/CompactConfig.html" title="class in com.sleepycat.db">CompactConfig</A> config)</CODE> |
| 215 |
|
| 216 |
<BR> |
| 217 |
Compact a Btree or Recno database or returns unused Btree, |
| 218 |
Hash or Recno database pages to the underlying filesystem.</TD> |
| 219 |
</TR> |
| 220 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 221 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 222 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 223 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#consume(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, boolean)">consume</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 224 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 225 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 226 |
boolean wait)</CODE> |
| 227 |
|
| 228 |
<BR> |
| 229 |
Return the record number and data from the available record closest to |
| 230 |
the head of the queue, and delete the record.</TD> |
| 231 |
</TR> |
| 232 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 233 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 234 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 235 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#delete(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">delete</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 236 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key)</CODE> |
| 237 |
|
| 238 |
<BR> |
| 239 |
Remove key/data pairs from the database.</TD> |
| 240 |
</TR> |
| 241 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 242 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 243 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 244 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#deleteMultiple(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry)">deleteMultiple</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 245 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> keys)</CODE> |
| 246 |
|
| 247 |
<BR> |
| 248 |
Remove key/data pairs from the database.</TD> |
| 249 |
</TR> |
| 250 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 251 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 252 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 253 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#deleteMultipleKey(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry)">deleteMultipleKey</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 254 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> keys)</CODE> |
| 255 |
|
| 256 |
<BR> |
| 257 |
Remove key/data pairs from the database.</TD> |
| 258 |
</TR> |
| 259 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 260 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 261 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 262 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#exists(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">exists</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 263 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key)</CODE> |
| 264 |
|
| 265 |
<BR> |
| 266 |
Checks if the specified key appears in the database.</TD> |
| 267 |
</TR> |
| 268 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 269 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 270 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 271 |
<TD><CODE><B><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></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 272 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 273 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 274 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> |
| 275 |
|
| 276 |
<BR> |
| 277 |
Retrieves the key/data pair with the given key from the database.</TD> |
| 278 |
</TR> |
| 279 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 280 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 281 |
<CODE> <A HREF="../../../com/sleepycat/db/CacheFile.html" title="class in com.sleepycat.db">CacheFile</A></CODE></FONT></TD> |
| 282 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getCacheFile()">getCacheFile</A></B>()</CODE> |
| 283 |
|
| 284 |
<BR> |
| 285 |
Return the handle for the cache file underlying the database.</TD> |
| 286 |
</TR> |
| 287 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 288 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 289 |
<CODE> <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A></CODE></FONT></TD> |
| 290 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getConfig()">getConfig</A></B>()</CODE> |
| 291 |
|
| 292 |
<BR> |
| 293 |
Return this Database object's configuration.</TD> |
| 294 |
</TR> |
| 295 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 296 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 297 |
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| 298 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getDatabaseFile()">getDatabaseFile</A></B>()</CODE> |
| 299 |
|
| 300 |
<BR> |
| 301 |
Return the database's underlying file name.</TD> |
| 302 |
</TR> |
| 303 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 304 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 305 |
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> |
| 306 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getDatabaseName()">getDatabaseName</A></B>()</CODE> |
| 307 |
|
| 308 |
<BR> |
| 309 |
Return the database name.</TD> |
| 310 |
</TR> |
| 311 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 312 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 313 |
<CODE> <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A></CODE></FONT></TD> |
| 314 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getEnvironment()">getEnvironment</A></B>()</CODE> |
| 315 |
|
| 316 |
<BR> |
| 317 |
Return the <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db"><CODE>Environment</CODE></A> handle for the database environment |
| 318 |
underlying the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A>.</TD> |
| 319 |
</TR> |
| 320 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 321 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 322 |
<CODE> <A HREF="../../../com/sleepycat/db/KeyRange.html" title="class in com.sleepycat.db">KeyRange</A></CODE></FONT></TD> |
| 323 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getKeyRange(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)">getKeyRange</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 324 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key)</CODE> |
| 325 |
|
| 326 |
<BR> |
| 327 |
Return an estimate of the proportion of keys in the database less |
| 328 |
than, equal to, and greater than the specified key.</TD> |
| 329 |
</TR> |
| 330 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 331 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 332 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 333 |
<TD><CODE><B><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></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 334 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 335 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 336 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> |
| 337 |
|
| 338 |
<BR> |
| 339 |
Retrieves the key/data pair with the given key and data value, that is, both |
| 340 |
the key and data items must match.</TD> |
| 341 |
</TR> |
| 342 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 343 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 344 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 345 |
<TD><CODE><B><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></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 346 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 347 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 348 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> |
| 349 |
|
| 350 |
<BR> |
| 351 |
Retrieves the key/data pair associated with the specific numbered record of the database.</TD> |
| 352 |
</TR> |
| 353 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 354 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 355 |
<CODE> <A HREF="../../../com/sleepycat/db/DatabaseStats.html" title="class in com.sleepycat.db">DatabaseStats</A></CODE></FONT></TD> |
| 356 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#getStats(com.sleepycat.db.Transaction, com.sleepycat.db.StatsConfig)">getStats</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 357 |
<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db">StatsConfig</A> config)</CODE> |
| 358 |
|
| 359 |
<BR> |
| 360 |
Return database statistics.</TD> |
| 361 |
</TR> |
| 362 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 363 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 364 |
<CODE> <A HREF="../../../com/sleepycat/db/JoinCursor.html" title="class in com.sleepycat.db">JoinCursor</A></CODE></FONT></TD> |
| 365 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#join(com.sleepycat.db.Cursor[], com.sleepycat.db.JoinConfig)">join</A></B>(<A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db">Cursor</A>[] cursors, |
| 366 |
<A HREF="../../../com/sleepycat/db/JoinConfig.html" title="class in com.sleepycat.db">JoinConfig</A> config)</CODE> |
| 367 |
|
| 368 |
<BR> |
| 369 |
Creates a specialized join cursor for use in performing equality or |
| 370 |
natural joins on secondary indices.</TD> |
| 371 |
</TR> |
| 372 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 373 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 374 |
<CODE> <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db">Cursor</A></CODE></FONT></TD> |
| 375 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.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> txn, |
| 376 |
<A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> |
| 377 |
|
| 378 |
<BR> |
| 379 |
Return a cursor into the database.</TD> |
| 380 |
</TR> |
| 381 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 382 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 383 |
<CODE> <A HREF="../../../com/sleepycat/db/Sequence.html" title="class in com.sleepycat.db">Sequence</A></CODE></FONT></TD> |
| 384 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#openSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)">openSequence</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 385 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 386 |
<A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A> config)</CODE> |
| 387 |
|
| 388 |
<BR> |
| 389 |
Open a sequence represented by the key in the database.</TD> |
| 390 |
</TR> |
| 391 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 392 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 393 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 394 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#put(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">put</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 395 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 396 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data)</CODE> |
| 397 |
|
| 398 |
<BR> |
| 399 |
|
| 400 |
Store the key/data pair into the database.</TD> |
| 401 |
</TR> |
| 402 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 403 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 404 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 405 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#putMultiple(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry, com.sleepycat.db.MultipleEntry, boolean)">putMultiple</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 406 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> key, |
| 407 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> data, |
| 408 |
boolean overwrite)</CODE> |
| 409 |
|
| 410 |
<BR> |
| 411 |
|
| 412 |
Store a set of key/data pairs into the database.</TD> |
| 413 |
</TR> |
| 414 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 415 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 416 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 417 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#putMultipleKey(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry, boolean)">putMultipleKey</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 418 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> key, |
| 419 |
boolean overwrite)</CODE> |
| 420 |
|
| 421 |
<BR> |
| 422 |
|
| 423 |
Store a set of key/data pairs into the database.</TD> |
| 424 |
</TR> |
| 425 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 426 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 427 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 428 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#putNoDupData(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">putNoDupData</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 429 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 430 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data)</CODE> |
| 431 |
|
| 432 |
<BR> |
| 433 |
|
| 434 |
Store the key/data pair into the database if it does not already appear |
| 435 |
in the database.</TD> |
| 436 |
</TR> |
| 437 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 438 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 439 |
<CODE> <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A></CODE></FONT></TD> |
| 440 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#putNoOverwrite(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)">putNoOverwrite</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 441 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 442 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data)</CODE> |
| 443 |
|
| 444 |
<BR> |
| 445 |
|
| 446 |
Store the key/data pair into the database if the key does not already |
| 447 |
appear in the database.</TD> |
| 448 |
</TR> |
| 449 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 450 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 451 |
<CODE>static void</CODE></FONT></TD> |
| 452 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#remove(java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)">remove</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 453 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 454 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config)</CODE> |
| 455 |
|
| 456 |
<BR> |
| 457 |
|
| 458 |
Remove the database specified by the file and database parameters.</TD> |
| 459 |
</TR> |
| 460 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 461 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 462 |
<CODE> void</CODE></FONT></TD> |
| 463 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#removeSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)">removeSequence</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 464 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 465 |
<A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A> config)</CODE> |
| 466 |
|
| 467 |
<BR> |
| 468 |
Remove the sequence from the database.</TD> |
| 469 |
</TR> |
| 470 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 471 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 472 |
<CODE>static void</CODE></FONT></TD> |
| 473 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#rename(java.lang.String, java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)">rename</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 474 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldDatabaseName, |
| 475 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> newDatabaseName, |
| 476 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config)</CODE> |
| 477 |
|
| 478 |
<BR> |
| 479 |
|
| 480 |
Rename a database specified by the file and database parameters.</TD> |
| 481 |
</TR> |
| 482 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 483 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 484 |
<CODE> void</CODE></FONT></TD> |
| 485 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#setConfig(com.sleepycat.db.DatabaseConfig)">setConfig</A></B>(<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config)</CODE> |
| 486 |
|
| 487 |
<BR> |
| 488 |
Change the settings in an existing database handle.</TD> |
| 489 |
</TR> |
| 490 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 491 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 492 |
<CODE>static void</CODE></FONT></TD> |
| 493 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#sortMultipleKeyAndData(com.sleepycat.db.MultipleDataEntry, com.sleepycat.db.MultipleDataEntry)">sortMultipleKeyAndData</A></B>(<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> keys, |
| 494 |
<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> datas)</CODE> |
| 495 |
|
| 496 |
<BR> |
| 497 |
Sorts two DatabaseEntry objects with multiple key and data pairs.</TD> |
| 498 |
</TR> |
| 499 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 500 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 501 |
<CODE>static void</CODE></FONT></TD> |
| 502 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#sortMultipleKeyData(com.sleepycat.db.MultipleKeyDataEntry)">sortMultipleKeyData</A></B>(<A HREF="../../../com/sleepycat/db/MultipleKeyDataEntry.html" title="class in com.sleepycat.db">MultipleKeyDataEntry</A> entries)</CODE> |
| 503 |
|
| 504 |
<BR> |
| 505 |
Sorts a DatabaseEntry with multiple matching key/data pairs.</TD> |
| 506 |
</TR> |
| 507 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 508 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 509 |
<CODE>static void</CODE></FONT></TD> |
| 510 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#sortMultipleKeyOrData(com.sleepycat.db.MultipleDataEntry)">sortMultipleKeyOrData</A></B>(<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> entries)</CODE> |
| 511 |
|
| 512 |
<BR> |
| 513 |
Sorts a DatabaseEntry with multiple key or data pairs.</TD> |
| 514 |
</TR> |
| 515 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 516 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 517 |
<CODE> void</CODE></FONT></TD> |
| 518 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#sync()">sync</A></B>()</CODE> |
| 519 |
|
| 520 |
<BR> |
| 521 |
Flush any cached information to disk.</TD> |
| 522 |
</TR> |
| 523 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 524 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 525 |
<CODE> int</CODE></FONT></TD> |
| 526 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#truncate(com.sleepycat.db.Transaction, boolean)">truncate</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 527 |
boolean countRecords)</CODE> |
| 528 |
|
| 529 |
<BR> |
| 530 |
Empty the database, discarding all records it contains.</TD> |
| 531 |
</TR> |
| 532 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 533 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 534 |
<CODE>static void</CODE></FONT></TD> |
| 535 |
<TD><CODE><B><A HREF="../../../com/sleepycat/db/Database.html#upgrade(java.lang.String, com.sleepycat.db.DatabaseConfig)">upgrade</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 536 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config)</CODE> |
| 537 |
|
| 538 |
<BR> |
| 539 |
Upgrade all of the databases included in the specified file.</TD> |
| 540 |
</TR> |
| 541 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 542 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 543 |
<CODE>static boolean</CODE></FONT></TD> |
| 544 |
<TD><CODE><B><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></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 545 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 546 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream</A> dumpStream, |
| 547 |
<A HREF="../../../com/sleepycat/db/VerifyConfig.html" title="class in com.sleepycat.db">VerifyConfig</A> verifyConfig, |
| 548 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> dbConfig)</CODE> |
| 549 |
|
| 550 |
<BR> |
| 551 |
Return if all of the databases in a file are uncorrupted.</TD> |
| 552 |
</TR> |
| 553 |
</TABLE> |
| 554 |
<A NAME="methods_inherited_from_class_java.lang.Object"></A> |
| 555 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 556 |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| 557 |
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
| 558 |
</TR> |
| 559 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 560 |
<TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> |
| 561 |
</TR> |
| 562 |
</TABLE> |
| 563 |
|
| 564 |
<P> |
| 565 |
|
| 566 |
|
| 567 |
|
| 568 |
<A NAME="constructor_detail"></A> |
| 569 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 570 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 571 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| 572 |
<B>Constructor Detail</B></FONT></TH> |
| 573 |
</TR> |
| 574 |
</TABLE> |
| 575 |
|
| 576 |
<A NAME="Database(java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 577 |
Database</H3> |
| 578 |
<PRE> |
| 579 |
public <B>Database</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> filename, |
| 580 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 581 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config) |
| 582 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>, |
| 583 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></PRE> |
| 584 |
<DL> |
| 585 |
<DD>Open a database. |
| 586 |
<p> |
| 587 |
The database is represented by the file and database parameters. |
| 588 |
<p> |
| 589 |
The currently supported database file formats (or <em>access |
| 590 |
methods</em>) are Btree, Hash, Queue, and Recno. The Btree format is a |
| 591 |
representation of a sorted, balanced tree structure. The Hash format |
| 592 |
is an extensible, dynamic hashing scheme. The Queue format supports |
| 593 |
fast access to fixed-length records accessed sequentially or by logical |
| 594 |
record number. The Recno format supports fixed- or variable-length |
| 595 |
records, accessed sequentially or by logical record number, and |
| 596 |
optionally backed by a flat text file. |
| 597 |
<p> |
| 598 |
Storage 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> |
| 599 |
for more information. |
| 600 |
<p> |
| 601 |
Opening a database is a relatively expensive operation, and maintaining |
| 602 |
a set of open databases will normally be preferable to repeatedly |
| 603 |
opening and closing the database for each new query. |
| 604 |
<p> |
| 605 |
In-memory databases never intended to be preserved on disk may be |
| 606 |
created by setting both the fileName and databaseName parameters to |
| 607 |
null. Note that in-memory databases can only ever be shared by sharing |
| 608 |
the single database handle that created them, in circumstances where |
| 609 |
doing so is safe. The environment variable <code>TMPDIR</code> may |
| 610 |
be used as a directory in which to create temporary backing files. |
| 611 |
<p> |
| 612 |
<P> |
| 613 |
<DL> |
| 614 |
<DT><B>Parameters:</B><DD><CODE>filename</CODE> - The name of an underlying file that will be used to back the database. |
| 615 |
On Windows platforms, this argument will be interpreted as a UTF-8 |
| 616 |
string, which is equivalent to ASCII for Latin characters. |
| 617 |
<p><DD><CODE>databaseName</CODE> - An optional parameter that allows applications to have multiple |
| 618 |
databases in a single file. Although no databaseName parameter needs |
| 619 |
to be specified, it is an error to attempt to open a second database in |
| 620 |
a physical file that was not initially created using a databaseName |
| 621 |
parameter. Further, the databaseName parameter is not supported by the |
| 622 |
Queue format. |
| 623 |
<p><DD><CODE>config</CODE> - The database open attributes. If null, default attributes are used. |
| 624 |
<DT><B>Throws:</B> |
| 625 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> |
| 626 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></CODE></DL> |
| 627 |
</DL> |
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
<A NAME="method_detail"></A> |
| 632 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 633 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 634 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| 635 |
<B>Method Detail</B></FONT></TH> |
| 636 |
</TR> |
| 637 |
</TABLE> |
| 638 |
|
| 639 |
<A NAME="close(boolean)"></A><H3> |
| 640 |
close</H3> |
| 641 |
<PRE> |
| 642 |
public void <B>close</B>(boolean noSync) |
| 643 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 644 |
<DL> |
| 645 |
<DD>Flush any cached database information to disk, close any open cursors, |
| 646 |
free allocated resources, close underlying files, and discard the database handle. |
| 647 |
<p> |
| 648 |
Although closing a database handle will close any open cursors, it is |
| 649 |
recommended that applications explicitly close all their <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> |
| 650 |
handles before closing the database. The reason why is that when the cursor |
| 651 |
is explicitly closed, the memory allocated for it is reclaimed; however, |
| 652 |
this will not happen if you close a database while cursors are still open. |
| 653 |
The same rule, for the same reasons, hold true for |
| 654 |
<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handles. |
| 655 |
Make sure you close all your transaction handles before closing your database handle. |
| 656 |
<p> |
| 657 |
Because key/data pairs are cached in memory, failing to sync the file |
| 658 |
with the <A HREF="../../../com/sleepycat/db/Database.html#close(boolean)"><CODE>Database.close</CODE></A> or <A HREF="../../../com/sleepycat/db/Database.html#sync()"><CODE>Database.sync</CODE></A> methods |
| 659 |
may result in inconsistent or lost information. |
| 660 |
So, to ensure that any data cached in main memory are reflected |
| 661 |
in the underlying file system, applications should make a point to |
| 662 |
always either close database handles or sync their data to disk. |
| 663 |
<p> |
| 664 |
When multiple threads are using the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> handle |
| 665 |
concurrently, only a single thread may call this method. |
| 666 |
<p> |
| 667 |
The database handle may not be accessed again after this method is |
| 668 |
called, regardless of the method's success or failure. |
| 669 |
<p> |
| 670 |
When called on a database that is the primary database for a secondary |
| 671 |
index, the primary database should be closed only after all secondary |
| 672 |
indices which reference it have been closed. |
| 673 |
If you do not close the database handle explicitly, |
| 674 |
it will be closed when the environment handle that owns the database handle is closed. |
| 675 |
<P> |
| 676 |
<DD><DL> |
| 677 |
<DT><B>Parameters:</B><DD><CODE>noSync</CODE> - Do not flush cached information to disk. The noSync parameter is a |
| 678 |
dangerous option. It should be set only if the application is doing |
| 679 |
logging (with transactions) so that the database is recoverable after a |
| 680 |
system or application crash, or if the database is always generated from |
| 681 |
scratch after any system or application crash. |
| 682 |
<b> |
| 683 |
It is important to understand that flushing cached information to disk |
| 684 |
only minimizes the window of opportunity for corrupted data. |
| 685 |
<p> |
| 686 |
</b> |
| 687 |
Although unlikely, it is possible for database corruption to happen if |
| 688 |
a system or application crash occurs while writing data to the database. |
| 689 |
To ensure that database corruption never occurs, applications must |
| 690 |
either: use transactions and logging with automatic recovery; use |
| 691 |
logging and application-specific recovery; or edit a copy of the |
| 692 |
database, and once all applications using the database have successfully |
| 693 |
called this method, atomically replace the original database with the |
| 694 |
updated copy. |
| 695 |
<p> |
| 696 |
Note that this flag only works when the database has been opened using an environment. |
| 697 |
<p> |
| 698 |
<DT><B>Throws:</B> |
| 699 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 700 |
</DD> |
| 701 |
</DL> |
| 702 |
<HR> |
| 703 |
|
| 704 |
<A NAME="close()"></A><H3> |
| 705 |
close</H3> |
| 706 |
<PRE> |
| 707 |
public void <B>close</B>() |
| 708 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 709 |
<DL> |
| 710 |
<DD>Flush any cached database information to disk, close any open cursors, |
| 711 |
free allocated resources, close underlying files, and discard the database handle. |
| 712 |
<p> |
| 713 |
Although closing a database handle will close any open cursors, it is |
| 714 |
recommended that applications explicitly close all their <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> |
| 715 |
handles before closing the database. The reason why is that when the cursor |
| 716 |
is explicitly closed, the memory allocated for it is reclaimed; however, |
| 717 |
this will not happen if you close a database while cursors are still open. |
| 718 |
The same rule, for the same reasons, hold true for |
| 719 |
<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> handles. |
| 720 |
Make sure you close all your transaction handles before closing your database handle. |
| 721 |
<p> |
| 722 |
Because key/data pairs are cached in memory, failing to sync the file |
| 723 |
with the <A HREF="../../../com/sleepycat/db/Database.html#close(boolean)"><CODE>Database.close</CODE></A> or <A HREF="../../../com/sleepycat/db/Database.html#sync()"><CODE>Database.sync</CODE></A> methods |
| 724 |
may result in inconsistent or lost information. |
| 725 |
So, to ensure that any data cached in main memory are reflected |
| 726 |
in the underlying file system, applications should make a point to |
| 727 |
always either close database handles or sync their data to disk. |
| 728 |
<p> |
| 729 |
When multiple threads are using the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> handle |
| 730 |
concurrently, only a single thread may call this method. |
| 731 |
<p> |
| 732 |
The database handle may not be accessed again after this method is |
| 733 |
called, regardless of the method's success or failure. |
| 734 |
<p> |
| 735 |
When called on a database that is the primary database for a secondary |
| 736 |
index, the primary database should be closed only after all secondary |
| 737 |
indices which reference it have been closed. |
| 738 |
If you do not close the database handle explicitly, |
| 739 |
it will be closed when the environment handle that owns the database handle is closed. |
| 740 |
<p> |
| 741 |
<P> |
| 742 |
<DD><DL> |
| 743 |
|
| 744 |
<DT><B>Throws:</B> |
| 745 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 746 |
</DD> |
| 747 |
</DL> |
| 748 |
<HR> |
| 749 |
|
| 750 |
<A NAME="compact(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.CompactConfig)"></A><H3> |
| 751 |
compact</H3> |
| 752 |
<PRE> |
| 753 |
public <A HREF="../../../com/sleepycat/db/CompactStats.html" title="class in com.sleepycat.db">CompactStats</A> <B>compact</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 754 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> start, |
| 755 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> stop, |
| 756 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> end, |
| 757 |
<A HREF="../../../com/sleepycat/db/CompactConfig.html" title="class in com.sleepycat.db">CompactConfig</A> config) |
| 758 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 759 |
<DL> |
| 760 |
<DD>Compact a Btree or Recno database or returns unused Btree, |
| 761 |
Hash or Recno database pages to the underlying filesystem. |
| 762 |
<P> |
| 763 |
<DD><DL> |
| 764 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txnid |
| 765 |
parameter is a transaction handle returned from <A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)</CODE></A>, otherwise <code>NULL</code>. |
| 766 |
<p> |
| 767 |
If a transaction handle is supplied to this method, then the operation is performed |
| 768 |
using that transaction. In this event, large sections of the tree may be |
| 769 |
locked during the course of the transaction. |
| 770 |
<p> |
| 771 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 772 |
database, the operation will be implicitly transaction protected using multiple |
| 773 |
transactions. These transactions will be periodically committed to avoid locking |
| 774 |
large sections of the tree. Any deadlocks encountered cause the compaction operation |
| 775 |
to be retried from the point of the last transaction commit.<DD><CODE>start</CODE> - If not <code>null</code>, the <code>start</code> parameter is the starting |
| 776 |
point for compaction in a Btree or Recno database. Compaction will start |
| 777 |
at the smallest key greater than or equal to the specified key. If |
| 778 |
<code>null</code>, compaction will start at the beginning of the database.<DD><CODE>stop</CODE> - If not <code>null</code>, the <code>stop</code> parameter is the stopping |
| 779 |
point for compaction in a Btree or Recno database. Compaction will stop at |
| 780 |
the page with the smallest key greater than the specified key. If |
| 781 |
<code>null</code>, compaction will stop at the end of the database.<DD><CODE>end</CODE> - If not <code>null</code>, the <code>end</code> parameter will be filled in |
| 782 |
with the key marking the end of the compaction operation in a Btree or |
| 783 |
Recno database. It is generally the first key of the page where processing |
| 784 |
stopped.<DD><CODE>config</CODE> - The compaction operation attributes. If null, default attributes are used. |
| 785 |
<DT><B>Throws:</B> |
| 786 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 787 |
</DD> |
| 788 |
</DL> |
| 789 |
<HR> |
| 790 |
|
| 791 |
<A NAME="openCursor(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"></A><H3> |
| 792 |
openCursor</H3> |
| 793 |
<PRE> |
| 794 |
public <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> txn, |
| 795 |
<A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) |
| 796 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 797 |
<DL> |
| 798 |
<DD>Return a cursor into the database. |
| 799 |
<p> |
| 800 |
<P> |
| 801 |
<DD><DL> |
| 802 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - To use a cursor for writing to a transactional database, an explicit |
| 803 |
transaction must be specified. For read-only access to a transactional |
| 804 |
database, the transaction may be null. For a non-transactional database, |
| 805 |
the transaction must be null. |
| 806 |
<p> |
| 807 |
To transaction-protect cursor operations, cursors must be opened and closed |
| 808 |
within the context of a transaction, and the txn parameter specifies the |
| 809 |
transaction context in which the cursor will be used. |
| 810 |
<p><DD><CODE>config</CODE> - The cursor attributes. If null, default attributes are used. |
| 811 |
<p> |
| 812 |
<DT><B>Returns:</B><DD>A database cursor. |
| 813 |
<p> |
| 814 |
<DT><B>Throws:</B> |
| 815 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 816 |
</DD> |
| 817 |
</DL> |
| 818 |
<HR> |
| 819 |
|
| 820 |
<A NAME="openSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)"></A><H3> |
| 821 |
openSequence</H3> |
| 822 |
<PRE> |
| 823 |
public <A HREF="../../../com/sleepycat/db/Sequence.html" title="class in com.sleepycat.db">Sequence</A> <B>openSequence</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 824 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 825 |
<A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A> config) |
| 826 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 827 |
<DL> |
| 828 |
<DD>Open a sequence represented by the key in the database. |
| 829 |
<p> |
| 830 |
<P> |
| 831 |
<DD><DL> |
| 832 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified, or |
| 833 |
null may be specified to use auto-commit. For a non-transactional |
| 834 |
database, null must be specified. |
| 835 |
If no transaction handle is specified, but the operation occurs in a |
| 836 |
transactional database, the operation will be implicitly transaction protected. |
| 837 |
<p><DD><CODE>key</CODE> - The key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> of the sequence. |
| 838 |
It specifies which record in the database stores the persistent sequence data. |
| 839 |
<p><DD><CODE>config</CODE> - The sequence attributes. If null, default attributes are used. |
| 840 |
<p> |
| 841 |
<DT><B>Returns:</B><DD>A sequence handle. |
| 842 |
<p> |
| 843 |
<DT><B>Throws:</B> |
| 844 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 845 |
</DD> |
| 846 |
</DL> |
| 847 |
<HR> |
| 848 |
|
| 849 |
<A NAME="removeSequence(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.SequenceConfig)"></A><H3> |
| 850 |
removeSequence</H3> |
| 851 |
<PRE> |
| 852 |
public void <B>removeSequence</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 853 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 854 |
<A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A> config) |
| 855 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 856 |
<DL> |
| 857 |
<DD>Remove the sequence from the database. This method should not be called if |
| 858 |
there are open handles on this sequence. |
| 859 |
<p> |
| 860 |
<P> |
| 861 |
<DD><DL> |
| 862 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified, or |
| 863 |
null may be specified to use auto-commit. For a non-transactional |
| 864 |
database, null must be specified. |
| 865 |
If no transaction handle is specified, but the operation occurs in a |
| 866 |
transactional database, the operation will be implicitly transaction protected. |
| 867 |
<p><DD><CODE>key</CODE> - The key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> of the sequence. |
| 868 |
It specifies which record in the database stores the persistent sequence data. |
| 869 |
<p><DD><CODE>config</CODE> - The sequence attributes. If null, default attributes are used. |
| 870 |
<DT><B>Throws:</B> |
| 871 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 872 |
</DD> |
| 873 |
</DL> |
| 874 |
<HR> |
| 875 |
|
| 876 |
<A NAME="getDatabaseFile()"></A><H3> |
| 877 |
getDatabaseFile</H3> |
| 878 |
<PRE> |
| 879 |
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getDatabaseFile</B>() |
| 880 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 881 |
<DL> |
| 882 |
<DD>Return the database's underlying file name. |
| 883 |
<p> |
| 884 |
This method may be called at any time during the life of the application. |
| 885 |
<p> |
| 886 |
<P> |
| 887 |
<DD><DL> |
| 888 |
|
| 889 |
<DT><B>Returns:</B><DD>The database's underlying file name. |
| 890 |
<DT><B>Throws:</B> |
| 891 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 892 |
</DD> |
| 893 |
</DL> |
| 894 |
<HR> |
| 895 |
|
| 896 |
<A NAME="getDatabaseName()"></A><H3> |
| 897 |
getDatabaseName</H3> |
| 898 |
<PRE> |
| 899 |
public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getDatabaseName</B>() |
| 900 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 901 |
<DL> |
| 902 |
<DD>Return the database name. |
| 903 |
<p> |
| 904 |
This method may be called at any time during the life of the application. |
| 905 |
<p> |
| 906 |
<P> |
| 907 |
<DD><DL> |
| 908 |
|
| 909 |
<DT><B>Returns:</B><DD>The database name. |
| 910 |
<DT><B>Throws:</B> |
| 911 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 912 |
</DD> |
| 913 |
</DL> |
| 914 |
<HR> |
| 915 |
|
| 916 |
<A NAME="getConfig()"></A><H3> |
| 917 |
getConfig</H3> |
| 918 |
<PRE> |
| 919 |
public <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> <B>getConfig</B>() |
| 920 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 921 |
<DL> |
| 922 |
<DD>Return this Database object's configuration. |
| 923 |
<p> |
| 924 |
This may differ from the configuration used to open this object if |
| 925 |
the database existed previously. |
| 926 |
<p> |
| 927 |
<P> |
| 928 |
<DD><DL> |
| 929 |
|
| 930 |
<DT><B>Returns:</B><DD>This Database object's configuration. |
| 931 |
<p> |
| 932 |
<p> |
| 933 |
<DT><B>Throws:</B> |
| 934 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 935 |
</DD> |
| 936 |
</DL> |
| 937 |
<HR> |
| 938 |
|
| 939 |
<A NAME="setConfig(com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 940 |
setConfig</H3> |
| 941 |
<PRE> |
| 942 |
public void <B>setConfig</B>(<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config) |
| 943 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 944 |
<DL> |
| 945 |
<DD>Change the settings in an existing database handle. |
| 946 |
<p> |
| 947 |
<P> |
| 948 |
<DD><DL> |
| 949 |
<DT><B>Parameters:</B><DD><CODE>config</CODE> - The environment attributes. If null, default attributes are used. |
| 950 |
<p> |
| 951 |
<p> |
| 952 |
<DT><B>Throws:</B> |
| 953 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 954 |
<p> |
| 955 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 956 |
</DD> |
| 957 |
</DL> |
| 958 |
<HR> |
| 959 |
|
| 960 |
<A NAME="getEnvironment()"></A><H3> |
| 961 |
getEnvironment</H3> |
| 962 |
<PRE> |
| 963 |
public <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A> <B>getEnvironment</B>() |
| 964 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 965 |
<DL> |
| 966 |
<DD>Return the <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db"><CODE>Environment</CODE></A> handle for the database environment |
| 967 |
underlying the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A>. |
| 968 |
<p> |
| 969 |
This method may be called at any time during the life of the application. |
| 970 |
<p> |
| 971 |
<P> |
| 972 |
<DD><DL> |
| 973 |
|
| 974 |
<DT><B>Returns:</B><DD>The <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db"><CODE>Environment</CODE></A> handle for the database environment |
| 975 |
underlying the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A>. |
| 976 |
<p> |
| 977 |
<p> |
| 978 |
<DT><B>Throws:</B> |
| 979 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 980 |
</DD> |
| 981 |
</DL> |
| 982 |
<HR> |
| 983 |
|
| 984 |
<A NAME="getCacheFile()"></A><H3> |
| 985 |
getCacheFile</H3> |
| 986 |
<PRE> |
| 987 |
public <A HREF="../../../com/sleepycat/db/CacheFile.html" title="class in com.sleepycat.db">CacheFile</A> <B>getCacheFile</B>() |
| 988 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 989 |
<DL> |
| 990 |
<DD>Return the handle for the cache file underlying the database. |
| 991 |
<p> |
| 992 |
This method may be called at any time during the life of the application. |
| 993 |
<p> |
| 994 |
<P> |
| 995 |
<DD><DL> |
| 996 |
|
| 997 |
<DT><B>Returns:</B><DD>The handle for the cache file underlying the database. |
| 998 |
<p> |
| 999 |
<p> |
| 1000 |
<DT><B>Throws:</B> |
| 1001 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1002 |
</DD> |
| 1003 |
</DL> |
| 1004 |
<HR> |
| 1005 |
|
| 1006 |
<A NAME="append(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1007 |
append</H3> |
| 1008 |
<PRE> |
| 1009 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>append</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1010 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1011 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data) |
| 1012 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1013 |
<DL> |
| 1014 |
<DD><p> |
| 1015 |
Append the key/data pair to the end of the database. |
| 1016 |
<p> |
| 1017 |
The underlying database must be a Queue or Recno database. The record |
| 1018 |
number allocated to the record is returned in the key parameter. |
| 1019 |
<p> |
| 1020 |
There is a minor behavioral difference between the Recno and Queue |
| 1021 |
access methods this method. If a transaction enclosing this method |
| 1022 |
aborts, the record number may be decremented (and later reallocated by |
| 1023 |
a subsequent operation) in the Recno access method, but will not be |
| 1024 |
decremented or reallocated in the Queue access method. |
| 1025 |
<p> |
| 1026 |
It may be useful to modify the stored data based on the generated key. |
| 1027 |
If a callback function is specified using <A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setRecordNumberAppender(com.sleepycat.db.RecordNumberAppender)"><CODE>DatabaseConfig.setRecordNumberAppender</CODE></A>, it will be called after the record number has |
| 1028 |
been selected, but before the data has been stored. |
| 1029 |
<p> |
| 1030 |
<P> |
| 1031 |
<DD><DL> |
| 1032 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified, or null |
| 1033 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1034 |
must be specified. |
| 1035 |
<p><DD><CODE>key</CODE> - the key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> operated on. |
| 1036 |
<p><DD><CODE>data</CODE> - the data <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> stored. |
| 1037 |
<p> |
| 1038 |
<p> |
| 1039 |
<p> |
| 1040 |
<DT><B>Throws:</B> |
| 1041 |
<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 |
| 1042 |
deadlock. |
| 1043 |
<p> |
| 1044 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1045 |
</DD> |
| 1046 |
</DL> |
| 1047 |
<HR> |
| 1048 |
|
| 1049 |
<A NAME="consume(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, boolean)"></A><H3> |
| 1050 |
consume</H3> |
| 1051 |
<PRE> |
| 1052 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>consume</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1053 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1054 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 1055 |
boolean wait) |
| 1056 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1057 |
<DL> |
| 1058 |
<DD>Return the record number and data from the available record closest to |
| 1059 |
the head of the queue, and delete the record. The record number will be |
| 1060 |
returned in the <code>key</code> parameter, and the data will be returned |
| 1061 |
in the <code>data</code> parameter. A record is available if it is not |
| 1062 |
deleted and is not currently locked. The underlying database must be |
| 1063 |
of type Queue for this method to be called. |
| 1064 |
<p> |
| 1065 |
<P> |
| 1066 |
<DD><DL> |
| 1067 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified to |
| 1068 |
transaction-protect the operation, or null may be specified to perform the |
| 1069 |
operation without transaction protection. For a non-transactional database, |
| 1070 |
null must be specified.<DD><CODE>key</CODE> - the key |
| 1071 |
returned as output. Its byte array does not need to be initialized by the |
| 1072 |
caller.<DD><CODE>data</CODE> - the data |
| 1073 |
returned as output. Its byte array does not need to be initialized by the |
| 1074 |
caller.<DD><CODE>wait</CODE> - if there is no record available, this parameter determines whether the |
| 1075 |
method waits for one to become available, or returns immediately with |
| 1076 |
status <code>NOTFOUND</code>. |
| 1077 |
<p> |
| 1078 |
<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 |
| 1079 |
found; <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>. |
| 1080 |
<p> |
| 1081 |
<p> |
| 1082 |
<DT><B>Throws:</B> |
| 1083 |
<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 |
| 1084 |
deadlock. |
| 1085 |
<p> |
| 1086 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 1087 |
<p> |
| 1088 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1089 |
</DD> |
| 1090 |
</DL> |
| 1091 |
<HR> |
| 1092 |
|
| 1093 |
<A NAME="delete(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1094 |
delete</H3> |
| 1095 |
<PRE> |
| 1096 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>delete</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1097 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key) |
| 1098 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1099 |
<DL> |
| 1100 |
<DD>Remove key/data pairs from the database. |
| 1101 |
<p> |
| 1102 |
The key/data pair associated with the specified key is discarded |
| 1103 |
from the database. In the presence of duplicate key values, all |
| 1104 |
records associated with the designated key will be discarded. |
| 1105 |
<p> |
| 1106 |
The key/data pair is also deleted from any associated secondary |
| 1107 |
databases. |
| 1108 |
When called on a database that has been made into a secondary index, |
| 1109 |
this method deletes the key/data pair from the primary database and all secondary indices. |
| 1110 |
<p> |
| 1111 |
<P> |
| 1112 |
<DD><DL> |
| 1113 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1114 |
parameter is a Transaction object returned from the |
| 1115 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1116 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1117 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1118 |
For a transactional database, an explicit transaction may be specified, or null |
| 1119 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1120 |
must be specified. |
| 1121 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1122 |
database, the operation will be implicitly transaction protected. |
| 1123 |
<p><DD><CODE>key</CODE> - the key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> operated on. |
| 1124 |
<p> |
| 1125 |
<DT><B>Returns:</B><DD>The method will return <A HREF="../../../com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> if the |
| 1126 |
specified key is not found in the database; |
| 1127 |
The method will return <A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> if the |
| 1128 |
database is a Queue or Recno database and the specified key exists, |
| 1129 |
but was never explicitly created by the application or was later |
| 1130 |
deleted; |
| 1131 |
otherwise the method will return <A HREF="../../../com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>. |
| 1132 |
<p> |
| 1133 |
<p> |
| 1134 |
<DT><B>Throws:</B> |
| 1135 |
<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 |
| 1136 |
deadlock. |
| 1137 |
<p> |
| 1138 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1139 |
</DD> |
| 1140 |
</DL> |
| 1141 |
<HR> |
| 1142 |
|
| 1143 |
<A NAME="deleteMultiple(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry)"></A><H3> |
| 1144 |
deleteMultiple</H3> |
| 1145 |
<PRE> |
| 1146 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>deleteMultiple</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1147 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> keys) |
| 1148 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1149 |
<DL> |
| 1150 |
<DD>Remove key/data pairs from the database. |
| 1151 |
<p> |
| 1152 |
The key/data pairs associated with the specified keys are discarded |
| 1153 |
from the database. In the presence of duplicate key values, all |
| 1154 |
records associated with the designated keys will be discarded. |
| 1155 |
<p> |
| 1156 |
The key/data pairs are also deleted from any associated secondary |
| 1157 |
databases. When called on a database that has been made into a secondary |
| 1158 |
index, this method deletes the key/data pairs from the primary database and |
| 1159 |
all secondary indices. |
| 1160 |
<p> |
| 1161 |
<P> |
| 1162 |
<DD><DL> |
| 1163 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1164 |
parameter is a Transaction object returned from the |
| 1165 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> |
| 1166 |
method; if the operation is part of a Berkeley DB Concurrent Data Store |
| 1167 |
group, the txn parameter is a Transaction object returned from the |
| 1168 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> |
| 1169 |
method; otherwise null. For a transactional database, an explicit transaction |
| 1170 |
may be specified, or null may be specified to use auto-commit. For a |
| 1171 |
non-transactional database, null must be specified. If no transaction |
| 1172 |
handle is specified, but the operation occurs in a transactional database, |
| 1173 |
the operation will be implicitly transaction protected. |
| 1174 |
<p><DD><CODE>keys</CODE> - the set of keys |
| 1175 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A> operated on. |
| 1176 |
<p> |
| 1177 |
<DT><B>Returns:</B><DD>The method will return |
| 1178 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> |
| 1179 |
if the specified key is not found in the database; The method will return |
| 1180 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> |
| 1181 |
if the database is a Queue or Recno database and the specified key exists, |
| 1182 |
but was never explicitly created by the application or was later |
| 1183 |
deleted; otherwise the method will return |
| 1184 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>. |
| 1185 |
<p> |
| 1186 |
<p> |
| 1187 |
<DT><B>Throws:</B> |
| 1188 |
<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 |
| 1189 |
deadlock. |
| 1190 |
<p> |
| 1191 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1192 |
</DD> |
| 1193 |
</DL> |
| 1194 |
<HR> |
| 1195 |
|
| 1196 |
<A NAME="deleteMultipleKey(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry)"></A><H3> |
| 1197 |
deleteMultipleKey</H3> |
| 1198 |
<PRE> |
| 1199 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>deleteMultipleKey</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1200 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> keys) |
| 1201 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1202 |
<DL> |
| 1203 |
<DD>Remove key/data pairs from the database. |
| 1204 |
<p> |
| 1205 |
The specified key/data pairs are discarded from the database. |
| 1206 |
<p> |
| 1207 |
The key/data pairs are also deleted from any associated secondary |
| 1208 |
databases. When called on a database that has been made into a secondary |
| 1209 |
index, this method deletes the key/data pairs from the primary database and |
| 1210 |
all secondary indices. |
| 1211 |
<p> |
| 1212 |
<P> |
| 1213 |
<DD><DL> |
| 1214 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1215 |
parameter is a Transaction object returned from the |
| 1216 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> |
| 1217 |
method; if the operation is part of a Berkeley DB Concurrent Data Store |
| 1218 |
group, the txn parameter is a Transaction object returned from the |
| 1219 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> |
| 1220 |
method; otherwise null. For a transactional database, an explicit transaction |
| 1221 |
may be specified, or null may be specified to use auto-commit. For a |
| 1222 |
non-transactional database, null must be specified. If no transaction |
| 1223 |
handle is specified, but the operation occurs in a transactional database, |
| 1224 |
the operation will be implicitly transaction protected. |
| 1225 |
<p><DD><CODE>keys</CODE> - the set of key/data pairs |
| 1226 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A> operated on. |
| 1227 |
<p> |
| 1228 |
<DT><B>Returns:</B><DD>The method will return |
| 1229 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#NOTFOUND"><CODE>OperationStatus.NOTFOUND</CODE></A> |
| 1230 |
if the specified key is not found in the database; The method will return |
| 1231 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEMPTY"><CODE>OperationStatus.KEYEMPTY</CODE></A> |
| 1232 |
if the database is a Queue or Recno database and the specified key exists, |
| 1233 |
but was never explicitly created by the application or was later |
| 1234 |
deleted; otherwise the method will return |
| 1235 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#SUCCESS"><CODE>OperationStatus.SUCCESS</CODE></A>. |
| 1236 |
<p> |
| 1237 |
<p> |
| 1238 |
<DT><B>Throws:</B> |
| 1239 |
<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 |
| 1240 |
deadlock. |
| 1241 |
<p> |
| 1242 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1243 |
</DD> |
| 1244 |
</DL> |
| 1245 |
<HR> |
| 1246 |
|
| 1247 |
<A NAME="exists(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1248 |
exists</H3> |
| 1249 |
<PRE> |
| 1250 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>exists</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1251 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key) |
| 1252 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1253 |
<DL> |
| 1254 |
<DD>Checks if the specified key appears in the database. |
| 1255 |
<p> |
| 1256 |
<P> |
| 1257 |
<DD><DL> |
| 1258 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1259 |
parameter is a Transaction object returned from the |
| 1260 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1261 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1262 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1263 |
For a transactional database, an explicit transaction may be specified to |
| 1264 |
transaction-protect the operation, or null may be specified to perform the |
| 1265 |
operation without transaction protection. For a non-transactional database, |
| 1266 |
null must be specified. |
| 1267 |
If no transaction handle is specified, but the operation occurs in a |
| 1268 |
transactional database, the operation will be implicitly transaction protected. |
| 1269 |
<p><DD><CODE>key</CODE> - the key |
| 1270 |
used as input. It must be initialized with a non-null byte array by the |
| 1271 |
caller. |
| 1272 |
<p> |
| 1273 |
<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 |
| 1274 |
found; <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>. |
| 1275 |
<p> |
| 1276 |
<p> |
| 1277 |
<DT><B>Throws:</B> |
| 1278 |
<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 |
| 1279 |
deadlock. |
| 1280 |
<p> |
| 1281 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 1282 |
<p> |
| 1283 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1284 |
</DD> |
| 1285 |
</DL> |
| 1286 |
<HR> |
| 1287 |
|
| 1288 |
<A NAME="get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"></A><H3> |
| 1289 |
get</H3> |
| 1290 |
<PRE> |
| 1291 |
public <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> txn, |
| 1292 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1293 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 1294 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) |
| 1295 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1296 |
<DL> |
| 1297 |
<DD>Retrieves the key/data pair with the given key from the database. If the matching key has |
| 1298 |
duplicate values, the first data item in the set of duplicates is returned. |
| 1299 |
|
| 1300 |
<p>Duplicates are sorted by: |
| 1301 |
<ul> |
| 1302 |
<li> their sort order, if a duplicate sort function was specified. |
| 1303 |
<li>any explicit cursor designated insertion. |
| 1304 |
<li> by insert order. This is the default behavior. |
| 1305 |
</ul> |
| 1306 |
<p> |
| 1307 |
Retrieval of duplicates requires the use of <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> operations. |
| 1308 |
When called on a database that has been made into a secondary index, |
| 1309 |
this method returns the key from the secondary index and the data item from the primary database. |
| 1310 |
<p> |
| 1311 |
<P> |
| 1312 |
<DD><DL> |
| 1313 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1314 |
parameter is a Transaction object returned from the |
| 1315 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1316 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1317 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1318 |
For a transactional database, an explicit transaction may be specified to |
| 1319 |
transaction-protect the operation, or null may be specified to perform the |
| 1320 |
operation without transaction protection. For a non-transactional database, |
| 1321 |
null must be specified. |
| 1322 |
If no transaction handle is specified, but the operation occurs in a |
| 1323 |
transactional database, the operation will be implicitly transaction protected. |
| 1324 |
<p><DD><CODE>key</CODE> - the key |
| 1325 |
used as input. It must be initialized with a non-null byte array by the |
| 1326 |
caller. |
| 1327 |
<p> |
| 1328 |
<p><DD><CODE>data</CODE> - the data |
| 1329 |
returned as output. Its byte array does not need to be initialized by the |
| 1330 |
caller. |
| 1331 |
<p><DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used. |
| 1332 |
<p> |
| 1333 |
<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 |
| 1334 |
found; <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>. |
| 1335 |
<p> |
| 1336 |
<p> |
| 1337 |
<DT><B>Throws:</B> |
| 1338 |
<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 |
| 1339 |
deadlock. |
| 1340 |
<p> |
| 1341 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 1342 |
<p> |
| 1343 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1344 |
</DD> |
| 1345 |
</DL> |
| 1346 |
<HR> |
| 1347 |
|
| 1348 |
<A NAME="getKeyRange(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1349 |
getKeyRange</H3> |
| 1350 |
<PRE> |
| 1351 |
public <A HREF="../../../com/sleepycat/db/KeyRange.html" title="class in com.sleepycat.db">KeyRange</A> <B>getKeyRange</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1352 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key) |
| 1353 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1354 |
<DL> |
| 1355 |
<DD>Return an estimate of the proportion of keys in the database less |
| 1356 |
than, equal to, and greater than the specified key. |
| 1357 |
<p> |
| 1358 |
The underlying database must be of type Btree. |
| 1359 |
<p> |
| 1360 |
This method does not retain the locks it acquires for the life of |
| 1361 |
the transaction, so estimates are not repeatable. |
| 1362 |
<p> |
| 1363 |
<P> |
| 1364 |
<DD><DL> |
| 1365 |
<DT><B>Parameters:</B><DD><CODE>key</CODE> - The key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> being compared. |
| 1366 |
<p><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1367 |
parameter is a Transaction object returned from the |
| 1368 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1369 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1370 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1371 |
For a transactional database, an explicit transaction may be specified to |
| 1372 |
transaction-protect the operation, or null may be specified to perform the |
| 1373 |
operation without transaction protection. For a non-transactional database, |
| 1374 |
null must be specified. |
| 1375 |
If no transaction handle is specified, but the operation occurs in a |
| 1376 |
transactional database, the operation will be implicitly transaction protected. |
| 1377 |
<p> |
| 1378 |
<DT><B>Returns:</B><DD>An estimate of the proportion of keys in the database less than, |
| 1379 |
equal to, and greater than the specified key. |
| 1380 |
<p> |
| 1381 |
<p> |
| 1382 |
<DT><B>Throws:</B> |
| 1383 |
<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 |
| 1384 |
deadlock. |
| 1385 |
<p> |
| 1386 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1387 |
</DD> |
| 1388 |
</DL> |
| 1389 |
<HR> |
| 1390 |
|
| 1391 |
<A NAME="getSearchBoth(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"></A><H3> |
| 1392 |
getSearchBoth</H3> |
| 1393 |
<PRE> |
| 1394 |
public <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> txn, |
| 1395 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1396 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 1397 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) |
| 1398 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1399 |
<DL> |
| 1400 |
<DD>Retrieves the key/data pair with the given key and data value, that is, both |
| 1401 |
the key and data items must match. |
| 1402 |
<p> |
| 1403 |
<P> |
| 1404 |
<DD><DL> |
| 1405 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified to |
| 1406 |
transaction-protect the operation, or null may be specified to perform the |
| 1407 |
operation without transaction protection. For a non-transactional database, |
| 1408 |
null must be specified.<DD><CODE>key</CODE> - the key |
| 1409 |
used as input. It must be initialized with a non-null byte array by the |
| 1410 |
caller.<DD><CODE>data</CODE> - the data |
| 1411 |
used as input. It must be initialized with a non-null byte array by the |
| 1412 |
caller. |
| 1413 |
<p><DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used. |
| 1414 |
<p> |
| 1415 |
<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 |
| 1416 |
found; <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>. |
| 1417 |
<p> |
| 1418 |
<p> |
| 1419 |
<DT><B>Throws:</B> |
| 1420 |
<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 |
| 1421 |
deadlock. |
| 1422 |
<p> |
| 1423 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 1424 |
<p> |
| 1425 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1426 |
</DD> |
| 1427 |
</DL> |
| 1428 |
<HR> |
| 1429 |
|
| 1430 |
<A NAME="getSearchRecordNumber(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"></A><H3> |
| 1431 |
getSearchRecordNumber</H3> |
| 1432 |
<PRE> |
| 1433 |
public <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> txn, |
| 1434 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1435 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data, |
| 1436 |
<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) |
| 1437 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1438 |
<DL> |
| 1439 |
<DD>Retrieves the key/data pair associated with the specific numbered record of the database. |
| 1440 |
<p> |
| 1441 |
The data field of the specified key must be a byte array containing a |
| 1442 |
record number, as described in <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A>. This determines |
| 1443 |
the record to be retrieved. |
| 1444 |
<p> |
| 1445 |
For this method to be called, the underlying database must be of type |
| 1446 |
Btree, and it must have been configured to support record numbers. |
| 1447 |
<p> |
| 1448 |
If this method fails for any reason, the position of the cursor will be |
| 1449 |
unchanged. |
| 1450 |
<P> |
| 1451 |
<DD><DL> |
| 1452 |
<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key |
| 1453 |
returned as output. Its byte array does not need to be initialized by the |
| 1454 |
caller.<DD><CODE>data</CODE> - the data |
| 1455 |
returned as output. Multiple results can be retrieved by passing an object |
| 1456 |
that 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 |
| 1457 |
need to be initialized by the caller.<DD><CODE>lockMode</CODE> - the locking attributes; if null, default attributes are used. |
| 1458 |
<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 |
| 1459 |
found; <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>. |
| 1460 |
<DT><B>Throws:</B> |
| 1461 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if a DatabaseEntry parameter is null or |
| 1462 |
does not contain a required non-null byte array. |
| 1463 |
<p> |
| 1464 |
<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 |
| 1465 |
deadlock. |
| 1466 |
<p> |
| 1467 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an invalid parameter was specified. |
| 1468 |
<p> |
| 1469 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 1470 |
<p></DL> |
| 1471 |
</DD> |
| 1472 |
</DL> |
| 1473 |
<HR> |
| 1474 |
|
| 1475 |
<A NAME="put(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1476 |
put</H3> |
| 1477 |
<PRE> |
| 1478 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>put</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1479 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1480 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data) |
| 1481 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1482 |
<DL> |
| 1483 |
<DD><p> |
| 1484 |
Store the key/data pair into the database. |
| 1485 |
<p> |
| 1486 |
If the key already appears in the database and duplicates are not |
| 1487 |
configured, the existing key/data pair will be replaced. If the key |
| 1488 |
already appears in the database and sorted duplicates are configured, |
| 1489 |
the new data value is inserted at the correct sorted location. |
| 1490 |
If the key already appears in the database and unsorted duplicates are |
| 1491 |
configured, the new data value is appended at the end of the duplicate |
| 1492 |
set. |
| 1493 |
<p> |
| 1494 |
<P> |
| 1495 |
<DD><DL> |
| 1496 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1497 |
parameter is a Transaction object returned from the |
| 1498 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1499 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1500 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1501 |
For a transactional database, an explicit transaction may be specified, or null |
| 1502 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1503 |
must be specified. |
| 1504 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1505 |
database, the operation will be implicitly transaction protected. |
| 1506 |
<p><DD><CODE>key</CODE> - the key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> operated on. |
| 1507 |
<p><DD><CODE>data</CODE> - the data <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> stored. |
| 1508 |
<p> |
| 1509 |
<p> |
| 1510 |
<p> |
| 1511 |
<DT><B>Throws:</B> |
| 1512 |
<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 |
| 1513 |
deadlock. |
| 1514 |
<p> |
| 1515 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1516 |
</DD> |
| 1517 |
</DL> |
| 1518 |
<HR> |
| 1519 |
|
| 1520 |
<A NAME="putMultiple(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry, com.sleepycat.db.MultipleEntry, boolean)"></A><H3> |
| 1521 |
putMultiple</H3> |
| 1522 |
<PRE> |
| 1523 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>putMultiple</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1524 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> key, |
| 1525 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> data, |
| 1526 |
boolean overwrite) |
| 1527 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1528 |
<DL> |
| 1529 |
<DD><p> |
| 1530 |
Store a set of key/data pairs into the database. |
| 1531 |
<p> |
| 1532 |
The key and data parameters must contain corresponding key/data pairs. That is |
| 1533 |
the first entry in the multiple key is inserted with the first entry from the |
| 1534 |
data parameter. Similarly for all remaining keys in the set. |
| 1535 |
<p> |
| 1536 |
This method may not be called on databases configured with unsorted duplicates. |
| 1537 |
<p> |
| 1538 |
<P> |
| 1539 |
<DD><DL> |
| 1540 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1541 |
parameter is a Transaction object returned from the |
| 1542 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1543 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1544 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1545 |
For a transactional database, an explicit transaction may be specified, or null |
| 1546 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1547 |
must be specified. |
| 1548 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1549 |
database, the operation will be implicitly transaction protected. |
| 1550 |
<p><DD><CODE>key</CODE> - the set of keys <A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A> operated on. |
| 1551 |
<p><DD><CODE>data</CODE> - the set of data <A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A> stored. |
| 1552 |
<p><DD><CODE>overwrite</CODE> - if this flag is true and any of the keys already exist in the database, they will be replaced. Otherwise a KEYEXIST error will be returned. |
| 1553 |
<p> |
| 1554 |
<DT><B>Returns:</B><DD>If any of the key/data pairs already appear in the database, this method will |
| 1555 |
return <A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEXIST"><CODE>OperationStatus.KEYEXIST</CODE></A>. |
| 1556 |
<p> |
| 1557 |
<p> |
| 1558 |
<DT><B>Throws:</B> |
| 1559 |
<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 |
| 1560 |
deadlock. |
| 1561 |
<p> |
| 1562 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1563 |
</DD> |
| 1564 |
</DL> |
| 1565 |
<HR> |
| 1566 |
|
| 1567 |
<A NAME="putMultipleKey(com.sleepycat.db.Transaction, com.sleepycat.db.MultipleEntry, boolean)"></A><H3> |
| 1568 |
putMultipleKey</H3> |
| 1569 |
<PRE> |
| 1570 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>putMultipleKey</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1571 |
<A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A> key, |
| 1572 |
boolean overwrite) |
| 1573 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1574 |
<DL> |
| 1575 |
<DD><p> |
| 1576 |
Store a set of key/data pairs into the database. |
| 1577 |
<p> |
| 1578 |
This method may not be called on databases configured with unsorted duplicates. |
| 1579 |
<p> |
| 1580 |
<P> |
| 1581 |
<DD><DL> |
| 1582 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1583 |
parameter is a Transaction object returned from the |
| 1584 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1585 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1586 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1587 |
For a transactional database, an explicit transaction may be specified, or null |
| 1588 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1589 |
must be specified. |
| 1590 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1591 |
database, the operation will be implicitly transaction protected. |
| 1592 |
<p><DD><CODE>key</CODE> - the key and data sets <A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db"><CODE>MultipleEntry</CODE></A> operated on. |
| 1593 |
<p><DD><CODE>overwrite</CODE> - if this flag is true and any of the keys already exist in the database, they will be replaced. Otherwise a KEYEXIST error will be returned. |
| 1594 |
<p> |
| 1595 |
<DT><B>Returns:</B><DD>If any of the key/data pairs already appear in the database, this method will |
| 1596 |
return <A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEXIST"><CODE>OperationStatus.KEYEXIST</CODE></A>. |
| 1597 |
<p> |
| 1598 |
<p> |
| 1599 |
<DT><B>Throws:</B> |
| 1600 |
<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 |
| 1601 |
deadlock. |
| 1602 |
<p> |
| 1603 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1604 |
</DD> |
| 1605 |
</DL> |
| 1606 |
<HR> |
| 1607 |
|
| 1608 |
<A NAME="putNoDupData(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1609 |
putNoDupData</H3> |
| 1610 |
<PRE> |
| 1611 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>putNoDupData</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1612 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1613 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data) |
| 1614 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1615 |
<DL> |
| 1616 |
<DD><p> |
| 1617 |
Store the key/data pair into the database if it does not already appear |
| 1618 |
in the database. |
| 1619 |
<p> |
| 1620 |
This method may only be called if the underlying database has been |
| 1621 |
configured to support sorted duplicates. |
| 1622 |
(This method may not be specified to the Queue or Recno access methods.) |
| 1623 |
<p> |
| 1624 |
<P> |
| 1625 |
<DD><DL> |
| 1626 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1627 |
parameter is a Transaction object returned from the |
| 1628 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1629 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1630 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1631 |
For a transactional database, an explicit transaction may be specified, or null |
| 1632 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1633 |
must be specified. |
| 1634 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1635 |
database, the operation will be implicitly transaction protected. |
| 1636 |
<p><DD><CODE>key</CODE> - the key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> operated on. |
| 1637 |
<p><DD><CODE>data</CODE> - the data <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> stored. |
| 1638 |
<p> |
| 1639 |
<DT><B>Returns:</B><DD>If the key/data pair already appears in the database, this method will |
| 1640 |
return <A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEXIST"><CODE>OperationStatus.KEYEXIST</CODE></A>. |
| 1641 |
<p> |
| 1642 |
<p> |
| 1643 |
<DT><B>Throws:</B> |
| 1644 |
<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 |
| 1645 |
deadlock. |
| 1646 |
<p> |
| 1647 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1648 |
</DD> |
| 1649 |
</DL> |
| 1650 |
<HR> |
| 1651 |
|
| 1652 |
<A NAME="putNoOverwrite(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"></A><H3> |
| 1653 |
putNoOverwrite</H3> |
| 1654 |
<PRE> |
| 1655 |
public <A HREF="../../../com/sleepycat/db/OperationStatus.html" title="class in com.sleepycat.db">OperationStatus</A> <B>putNoOverwrite</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1656 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> key, |
| 1657 |
<A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db">DatabaseEntry</A> data) |
| 1658 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1659 |
<DL> |
| 1660 |
<DD><p> |
| 1661 |
Store the key/data pair into the database if the key does not already |
| 1662 |
appear in the database. |
| 1663 |
<p> |
| 1664 |
This method will fail if the key already exists in the database, even |
| 1665 |
if the database supports duplicates. |
| 1666 |
<p> |
| 1667 |
<P> |
| 1668 |
<DD><DL> |
| 1669 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1670 |
parameter is a Transaction object returned from the |
| 1671 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1672 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1673 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1674 |
For a transactional database, an explicit transaction may be specified, or null |
| 1675 |
may be specified to use auto-commit. For a non-transactional database, null |
| 1676 |
must be specified. |
| 1677 |
If no transaction handle is specified, but the operation occurs in a transactional |
| 1678 |
database, the operation will be implicitly transaction protected. |
| 1679 |
<p><DD><CODE>key</CODE> - the key <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> operated on. |
| 1680 |
<p><DD><CODE>data</CODE> - the data <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> stored. |
| 1681 |
<p> |
| 1682 |
<DT><B>Returns:</B><DD>If the key already appears in the database, this method will return |
| 1683 |
<A HREF="../../../com/sleepycat/db/OperationStatus.html#KEYEXIST"><CODE>OperationStatus.KEYEXIST</CODE></A>. |
| 1684 |
<p> |
| 1685 |
<p> |
| 1686 |
<DT><B>Throws:</B> |
| 1687 |
<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 |
| 1688 |
deadlock. |
| 1689 |
<p> |
| 1690 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1691 |
</DD> |
| 1692 |
</DL> |
| 1693 |
<HR> |
| 1694 |
|
| 1695 |
<A NAME="join(com.sleepycat.db.Cursor[], com.sleepycat.db.JoinConfig)"></A><H3> |
| 1696 |
join</H3> |
| 1697 |
<PRE> |
| 1698 |
public <A HREF="../../../com/sleepycat/db/JoinCursor.html" title="class in com.sleepycat.db">JoinCursor</A> <B>join</B>(<A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db">Cursor</A>[] cursors, |
| 1699 |
<A HREF="../../../com/sleepycat/db/JoinConfig.html" title="class in com.sleepycat.db">JoinConfig</A> config) |
| 1700 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1701 |
<DL> |
| 1702 |
<DD>Creates a specialized join cursor for use in performing equality or |
| 1703 |
natural joins on secondary indices. |
| 1704 |
<p> |
| 1705 |
Each cursor in the <code>cursors</code> array must have been |
| 1706 |
initialized to refer to the key on which the underlying database should |
| 1707 |
be joined. Typically, this initialization is done by calling |
| 1708 |
<A HREF="../../../com/sleepycat/db/Cursor.html#getSearchKey(com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><CODE>Cursor.getSearchKey</CODE></A>. |
| 1709 |
<p> |
| 1710 |
Once the cursors have been passed to this method, they should not be |
| 1711 |
accessed or modified until the newly created join cursor has been |
| 1712 |
closed, or else inconsistent results may be returned. However, the |
| 1713 |
position of the cursors will not be changed by this method or by the |
| 1714 |
methods of the join cursor. |
| 1715 |
<p> |
| 1716 |
<P> |
| 1717 |
<DD><DL> |
| 1718 |
<DT><B>Parameters:</B><DD><CODE>cursors</CODE> - an array of cursors associated with this primary |
| 1719 |
database. |
| 1720 |
<p><DD><CODE>config</CODE> - The join attributes. If null, default attributes are used. |
| 1721 |
<p> |
| 1722 |
<DT><B>Returns:</B><DD>a specialized cursor that returns the results of the equality join |
| 1723 |
operation. |
| 1724 |
<p> |
| 1725 |
<DT><B>Throws:</B> |
| 1726 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 1727 |
<p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/JoinCursor.html" title="class in com.sleepycat.db"><CODE>JoinCursor</CODE></A></DL> |
| 1728 |
</DD> |
| 1729 |
</DL> |
| 1730 |
<HR> |
| 1731 |
|
| 1732 |
<A NAME="truncate(com.sleepycat.db.Transaction, boolean)"></A><H3> |
| 1733 |
truncate</H3> |
| 1734 |
<PRE> |
| 1735 |
public int <B>truncate</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1736 |
boolean countRecords) |
| 1737 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1738 |
<DL> |
| 1739 |
<DD>Empty the database, discarding all records it contains. |
| 1740 |
<p> |
| 1741 |
When called on a database configured with secondary indices, this |
| 1742 |
method truncates the primary database and all secondary indices. If |
| 1743 |
configured to return a count of the records discarded, the returned |
| 1744 |
count is the count of records discarded from the primary database. |
| 1745 |
<p> |
| 1746 |
It is an error to call this method on a database with open cursors. |
| 1747 |
<p> |
| 1748 |
<P> |
| 1749 |
<DD><DL> |
| 1750 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - For a transactional database, an explicit transaction may be specified, or |
| 1751 |
null may be specified to use auto-commit. For a non-transactional |
| 1752 |
database, null must be specified. |
| 1753 |
If no transaction handle is specified, but the operation occurs in a |
| 1754 |
transactional database, the operation will be implicitly transaction protected. |
| 1755 |
<p><DD><CODE>countRecords</CODE> - If true, count and return the number of records discarded. |
| 1756 |
<p> |
| 1757 |
<DT><B>Returns:</B><DD>The number of records discarded, or -1 if returnCount is false. |
| 1758 |
<p> |
| 1759 |
<DT><B>Throws:</B> |
| 1760 |
<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 |
| 1761 |
deadlock. |
| 1762 |
<p> |
| 1763 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1764 |
</DD> |
| 1765 |
</DL> |
| 1766 |
<HR> |
| 1767 |
|
| 1768 |
<A NAME="getStats(com.sleepycat.db.Transaction, com.sleepycat.db.StatsConfig)"></A><H3> |
| 1769 |
getStats</H3> |
| 1770 |
<PRE> |
| 1771 |
public <A HREF="../../../com/sleepycat/db/DatabaseStats.html" title="class in com.sleepycat.db">DatabaseStats</A> <B>getStats</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, |
| 1772 |
<A HREF="../../../com/sleepycat/db/StatsConfig.html" title="class in com.sleepycat.db">StatsConfig</A> config) |
| 1773 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1774 |
<DL> |
| 1775 |
<DD>Return database statistics. |
| 1776 |
<p> |
| 1777 |
If this method has not been configured to avoid expensive operations |
| 1778 |
(using the <A HREF="../../../com/sleepycat/db/StatsConfig.html#setFast(boolean)"><CODE>StatsConfig.setFast</CODE></A> method), it will access |
| 1779 |
some of or all the pages in the database, incurring a severe |
| 1780 |
performance penalty as well as possibly flushing the underlying |
| 1781 |
buffer pool. |
| 1782 |
<p> |
| 1783 |
In the presence of multiple threads or processes accessing an active |
| 1784 |
database, the information returned by this method may be out-of-date. |
| 1785 |
<p> |
| 1786 |
If the database was not opened read-only and this method was not |
| 1787 |
configured using the <A HREF="../../../com/sleepycat/db/StatsConfig.html#setFast(boolean)"><CODE>StatsConfig.setFast</CODE></A> method, cached |
| 1788 |
key and record numbers will be updated after the statistical |
| 1789 |
information has been gathered. |
| 1790 |
<p> |
| 1791 |
<P> |
| 1792 |
<DD><DL> |
| 1793 |
<DT><B>Parameters:</B><DD><CODE>txn</CODE> - If the operation is part of an application-specified transaction, the txn |
| 1794 |
parameter is a Transaction object returned from the |
| 1795 |
<A HREF="../../../com/sleepycat/db/Environment.html#beginTransaction(com.sleepycat.db.Transaction, com.sleepycat.db.TransactionConfig)"><CODE>Environment.beginTransaction</CODE></A> method; if the operation is part of a Berkeley DB |
| 1796 |
Concurrent Data Store group, the txn parameter is a Transaction object returned |
| 1797 |
from the <A HREF="../../../com/sleepycat/db/Environment.html#beginCDSGroup()"><CODE>Environment.beginCDSGroup</CODE></A> method; otherwise null. |
| 1798 |
For a transactional database, an explicit transaction may be specified to |
| 1799 |
transaction-protect the operation, or null may be specified to perform the |
| 1800 |
operation without transaction protection. For a non-transactional |
| 1801 |
database, null must be specified. |
| 1802 |
If no transaction handle is specified, but the operation occurs in a |
| 1803 |
transactional database, the operation will be implicitly transaction protected. |
| 1804 |
<p><DD><CODE>config</CODE> - The statistics returned; if null, default statistics are returned. |
| 1805 |
<p> |
| 1806 |
<DT><B>Returns:</B><DD>Database statistics. |
| 1807 |
<p> |
| 1808 |
<DT><B>Throws:</B> |
| 1809 |
<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 |
| 1810 |
deadlock. |
| 1811 |
<p> |
| 1812 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 1813 |
</DD> |
| 1814 |
</DL> |
| 1815 |
<HR> |
| 1816 |
|
| 1817 |
<A NAME="remove(java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 1818 |
remove</H3> |
| 1819 |
<PRE> |
| 1820 |
public static void <B>remove</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 1821 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 1822 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config) |
| 1823 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>, |
| 1824 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></PRE> |
| 1825 |
<DL> |
| 1826 |
<DD><p> |
| 1827 |
Remove the database specified by the file and database parameters. |
| 1828 |
<p> |
| 1829 |
If no database is specified, the underlying file specified is removed, |
| 1830 |
incidentally removing all of the databases it contained.. |
| 1831 |
<p> |
| 1832 |
Applications should never remove databases with open <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> |
| 1833 |
handles, or in the case of removing a file, when any database in the |
| 1834 |
file has an open handle. For example, some architectures do not permit |
| 1835 |
the removal of files with open system handles. On these architectures, |
| 1836 |
attempts to remove databases currently in use by any thread of control |
| 1837 |
in the system may fail. |
| 1838 |
<p> |
| 1839 |
If the database was opened within a database environment, the |
| 1840 |
environment variable DB_HOME may be used as the path of the database |
| 1841 |
environment home. |
| 1842 |
This method may not be called after calling the open method on any database handle. |
| 1843 |
If the open method has already been called on a database handle, |
| 1844 |
close the existing handle and create a new one before calling the remove method. |
| 1845 |
This method should not be called if the remove is intended to be transactionally safe; |
| 1846 |
the <A HREF="../../../com/sleepycat/db/Environment.html#removeDatabase(com.sleepycat.db.Transaction, java.lang.String, java.lang.String)"><CODE>Environment.removeDatabase</CODE></A> method should be used instead. |
| 1847 |
|
| 1848 |
<p> |
| 1849 |
This method is affected by any database directory specified with |
| 1850 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#addDataDir(java.io.File)"><CODE>EnvironmentConfig.addDataDir</CODE></A>, or by setting the "set_data_dir" |
| 1851 |
string in the database environment's DB_CONFIG file. |
| 1852 |
<p> |
| 1853 |
The <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> handle may not be accessed |
| 1854 |
again after this method is called, regardless of this method's success |
| 1855 |
or failure. |
| 1856 |
<p> |
| 1857 |
<P> |
| 1858 |
<DD><DL> |
| 1859 |
<DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The physical file which contains the database to be removed. |
| 1860 |
On Windows platforms, this argument will be interpreted as a UTF-8 |
| 1861 |
string, which is equivalent to ASCII for Latin characters. |
| 1862 |
<p><DD><CODE>databaseName</CODE> - The database to be removed. |
| 1863 |
<p><DD><CODE>config</CODE> - The database remove attributes. If null, default attributes are used. |
| 1864 |
<p> |
| 1865 |
<p> |
| 1866 |
<DT><B>Throws:</B> |
| 1867 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 1868 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></CODE></DL> |
| 1869 |
</DD> |
| 1870 |
</DL> |
| 1871 |
<HR> |
| 1872 |
|
| 1873 |
<A NAME="rename(java.lang.String, java.lang.String, java.lang.String, com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 1874 |
rename</H3> |
| 1875 |
<PRE> |
| 1876 |
public static void <B>rename</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 1877 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> oldDatabaseName, |
| 1878 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> newDatabaseName, |
| 1879 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config) |
| 1880 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>, |
| 1881 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></PRE> |
| 1882 |
<DL> |
| 1883 |
<DD><p> |
| 1884 |
Rename a database specified by the file and database parameters. |
| 1885 |
<p> |
| 1886 |
If no database name is specified, the underlying file specified is |
| 1887 |
renamed, incidentally renaming all of the databases it contains. |
| 1888 |
<p> |
| 1889 |
Applications should never rename databases that are currently in use. |
| 1890 |
If an underlying file is being renamed and logging is currently enabled |
| 1891 |
in the database environment, no database in the file may be open when |
| 1892 |
this method is called. In particular, some architectures do not permit |
| 1893 |
renaming files with open handles. On these architectures, attempts to |
| 1894 |
rename databases that are currently in use by any thread of control in |
| 1895 |
the system may fail. |
| 1896 |
<p> |
| 1897 |
If the database was opened within a database environment, the |
| 1898 |
environment variable DB_HOME may be used as the path of the database |
| 1899 |
environment home. This method should not be called if the rename is intended |
| 1900 |
to be transactionally safe; the |
| 1901 |
<A HREF="../../../com/sleepycat/db/Environment.html#renameDatabase(com.sleepycat.db.Transaction, java.lang.String, java.lang.String, java.lang.String)"><CODE>Environment.renameDatabase</CODE></A> method should be used instead. |
| 1902 |
<p> |
| 1903 |
This method is affected by any database directory specified with |
| 1904 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#addDataDir(java.io.File)"><CODE>EnvironmentConfig.addDataDir</CODE></A>, or by setting the "set_data_dir" |
| 1905 |
string in the database environment's DB_CONFIG file. |
| 1906 |
This method may not be called after calling the open method on any database handle. |
| 1907 |
If the open method has already been called on a database handle, |
| 1908 |
close the existing handle and create a new one before calling the rename method. |
| 1909 |
<p> |
| 1910 |
The <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> handle may not be accessed |
| 1911 |
again after this method is called, regardless of this method's success |
| 1912 |
or failure. |
| 1913 |
<p> |
| 1914 |
<P> |
| 1915 |
<DD><DL> |
| 1916 |
<DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The physical file which contains the database to be renamed. |
| 1917 |
On Windows platforms, this argument will be interpreted as a UTF-8 |
| 1918 |
string, which is equivalent to ASCII for Latin characters. |
| 1919 |
<p><DD><CODE>oldDatabaseName</CODE> - The database to be renamed. |
| 1920 |
<p><DD><CODE>newDatabaseName</CODE> - The new name of the database or file. |
| 1921 |
<p><DD><CODE>config</CODE> - The database rename attributes. If null, default attributes are used. |
| 1922 |
<p> |
| 1923 |
<p> |
| 1924 |
<DT><B>Throws:</B> |
| 1925 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 1926 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></CODE></DL> |
| 1927 |
</DD> |
| 1928 |
</DL> |
| 1929 |
<HR> |
| 1930 |
|
| 1931 |
<A NAME="sortMultipleKeyData(com.sleepycat.db.MultipleKeyDataEntry)"></A><H3> |
| 1932 |
sortMultipleKeyData</H3> |
| 1933 |
<PRE> |
| 1934 |
public static void <B>sortMultipleKeyData</B>(<A HREF="../../../com/sleepycat/db/MultipleKeyDataEntry.html" title="class in com.sleepycat.db">MultipleKeyDataEntry</A> entries) |
| 1935 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1936 |
<DL> |
| 1937 |
<DD>Sorts a DatabaseEntry with multiple matching key/data pairs. |
| 1938 |
<p> |
| 1939 |
If specified, the application specific btree comparison and duplicate |
| 1940 |
comparison functions will be used. |
| 1941 |
<p> |
| 1942 |
<P> |
| 1943 |
<DD><DL> |
| 1944 |
<DT><B>Parameters:</B><DD><CODE>entries</CODE> - A MultipleKeyDataEntry that contains matching pairs of key/data items, |
| 1945 |
the sorted entries will be returned in the original entries object. |
| 1946 |
<DT><B>Throws:</B> |
| 1947 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 1948 |
</DD> |
| 1949 |
</DL> |
| 1950 |
<HR> |
| 1951 |
|
| 1952 |
<A NAME="sortMultipleKeyOrData(com.sleepycat.db.MultipleDataEntry)"></A><H3> |
| 1953 |
sortMultipleKeyOrData</H3> |
| 1954 |
<PRE> |
| 1955 |
public static void <B>sortMultipleKeyOrData</B>(<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> entries) |
| 1956 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1957 |
<DL> |
| 1958 |
<DD>Sorts a DatabaseEntry with multiple key or data pairs. |
| 1959 |
<p> |
| 1960 |
If specified, the application specific btree comparison function will be |
| 1961 |
used. |
| 1962 |
<p> |
| 1963 |
<P> |
| 1964 |
<DD><DL> |
| 1965 |
<DT><B>Parameters:</B><DD><CODE>entries</CODE> - A MultipleDataEntry that contains multiple key or data items, |
| 1966 |
the sorted entries will be returned in the original entries object. |
| 1967 |
<DT><B>Throws:</B> |
| 1968 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 1969 |
</DD> |
| 1970 |
</DL> |
| 1971 |
<HR> |
| 1972 |
|
| 1973 |
<A NAME="sortMultipleKeyAndData(com.sleepycat.db.MultipleDataEntry, com.sleepycat.db.MultipleDataEntry)"></A><H3> |
| 1974 |
sortMultipleKeyAndData</H3> |
| 1975 |
<PRE> |
| 1976 |
public static void <B>sortMultipleKeyAndData</B>(<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> keys, |
| 1977 |
<A HREF="../../../com/sleepycat/db/MultipleDataEntry.html" title="class in com.sleepycat.db">MultipleDataEntry</A> datas) |
| 1978 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1979 |
<DL> |
| 1980 |
<DD>Sorts two DatabaseEntry objects with multiple key and data pairs. |
| 1981 |
<p> |
| 1982 |
If specified, the application specific btree comparison and duplicate |
| 1983 |
comparison functions will be used. |
| 1984 |
<p> |
| 1985 |
The key and data parameters must contain "pairs" of items. That is the n-th |
| 1986 |
entry in keys corresponds to the n-th entry in datas. |
| 1987 |
<P> |
| 1988 |
<DD><DL> |
| 1989 |
<DT><B>Parameters:</B><DD><CODE>keys</CODE> - A MultipleDataEntry that contains multiple key items, the sorted entries |
| 1990 |
will be returned in the original entries object.<DD><CODE>datas</CODE> - A MultipleDataEntry that contains multiple data items, the sorted entries |
| 1991 |
will be returned in the original entries object. |
| 1992 |
<DT><B>Throws:</B> |
| 1993 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> |
| 1994 |
</DD> |
| 1995 |
</DL> |
| 1996 |
<HR> |
| 1997 |
|
| 1998 |
<A NAME="sync()"></A><H3> |
| 1999 |
sync</H3> |
| 2000 |
<PRE> |
| 2001 |
public void <B>sync</B>() |
| 2002 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 2003 |
<DL> |
| 2004 |
<DD>Flush any cached information to disk. |
| 2005 |
<p> |
| 2006 |
If the database is in memory only, this method has no effect and |
| 2007 |
will always succeed. |
| 2008 |
<p> |
| 2009 |
<b>It is important to understand that flushing cached information to |
| 2010 |
disk only minimizes the window of opportunity for corrupted data.</b> |
| 2011 |
<p> |
| 2012 |
Although unlikely, it is possible for database corruption to happen |
| 2013 |
if a system or application crash occurs while writing data to the |
| 2014 |
database. To ensure that database corruption never occurs, |
| 2015 |
applications must either: use transactions and logging with |
| 2016 |
automatic recovery; use logging and application-specific recovery; |
| 2017 |
or edit a copy of the database, and once all applications using the |
| 2018 |
database have successfully closed the copy of the database, |
| 2019 |
atomically replace the original database with the updated copy. |
| 2020 |
<p> |
| 2021 |
<p> |
| 2022 |
<P> |
| 2023 |
<DD><DL> |
| 2024 |
|
| 2025 |
<DT><B>Throws:</B> |
| 2026 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs.</DL> |
| 2027 |
</DD> |
| 2028 |
</DL> |
| 2029 |
<HR> |
| 2030 |
|
| 2031 |
<A NAME="upgrade(java.lang.String, com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 2032 |
upgrade</H3> |
| 2033 |
<PRE> |
| 2034 |
public static void <B>upgrade</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 2035 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> config) |
| 2036 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>, |
| 2037 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></PRE> |
| 2038 |
<DL> |
| 2039 |
<DD>Upgrade all of the databases included in the specified file. |
| 2040 |
<p> |
| 2041 |
If no upgrade is necessary, always returns success. |
| 2042 |
<p> |
| 2043 |
<b> |
| 2044 |
Database upgrades are done in place and are destructive. For example, |
| 2045 |
if pages need to be allocated and no disk space is available, the |
| 2046 |
database may be left corrupted. Backups should be made before databases |
| 2047 |
are upgraded. |
| 2048 |
</b> |
| 2049 |
<p> |
| 2050 |
<b> |
| 2051 |
The following information is only meaningful when upgrading databases |
| 2052 |
from releases before the Berkeley DB 3.1 release: |
| 2053 |
</b> |
| 2054 |
<p> |
| 2055 |
As part of the upgrade from the Berkeley DB 3.0 release to the 3.1 |
| 2056 |
release, the on-disk format of duplicate data items changed. To |
| 2057 |
correctly upgrade the format requires applications to specify |
| 2058 |
whether duplicate data items in the database are sorted or not. |
| 2059 |
Configuring the database object to support sorted duplicates by the |
| 2060 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setSortedDuplicates(boolean)"><CODE>DatabaseConfig.setSortedDuplicates</CODE></A> method informs this |
| 2061 |
method that the duplicates are sorted; otherwise they are assumed |
| 2062 |
to be unsorted. Incorrectly specifying this configuration |
| 2063 |
information may lead to database corruption. |
| 2064 |
<p> |
| 2065 |
Further, because this method upgrades a physical file (including all |
| 2066 |
the databases it contains), it is not possible to use this method |
| 2067 |
to upgrade files in which some of the databases it includes have |
| 2068 |
sorted duplicate data items, and some of the databases it includes |
| 2069 |
have unsorted duplicate data items. If the file does not have more |
| 2070 |
than a single database, if the databases do not support duplicate |
| 2071 |
data items, or if all of the databases that support duplicate data |
| 2072 |
items support the same style of duplicates (either sorted or |
| 2073 |
unsorted), this method will work correctly as long as the duplicate |
| 2074 |
configuration is correctly specified. Otherwise, the file cannot |
| 2075 |
be upgraded using this method; it must be upgraded manually by |
| 2076 |
dumping and reloading the databases. |
| 2077 |
<p> |
| 2078 |
Unlike all other database operations, upgrades may only be done on |
| 2079 |
a system with the same byte-order as the database. |
| 2080 |
<p> |
| 2081 |
If the database was opened within a database environment, the |
| 2082 |
environment variable DB_HOME may be used as the path of the database |
| 2083 |
environment home. |
| 2084 |
<p> |
| 2085 |
This method is affected by any database directory specified with |
| 2086 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#addDataDir(java.io.File)"><CODE>EnvironmentConfig.addDataDir</CODE></A>, or by setting the "set_data_dir" |
| 2087 |
string in the database environment's DB_CONFIG file. |
| 2088 |
<p> |
| 2089 |
<P> |
| 2090 |
<DD><DL> |
| 2091 |
<DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The physical file containing the databases to be upgraded. |
| 2092 |
<p> |
| 2093 |
<p> |
| 2094 |
<DT><B>Throws:</B> |
| 2095 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 2096 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></CODE></DL> |
| 2097 |
</DD> |
| 2098 |
</DL> |
| 2099 |
<HR> |
| 2100 |
|
| 2101 |
<A NAME="verify(java.lang.String, java.lang.String, java.io.PrintStream, com.sleepycat.db.VerifyConfig, com.sleepycat.db.DatabaseConfig)"></A><H3> |
| 2102 |
verify</H3> |
| 2103 |
<PRE> |
| 2104 |
public static boolean <B>verify</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> fileName, |
| 2105 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> databaseName, |
| 2106 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream</A> dumpStream, |
| 2107 |
<A HREF="../../../com/sleepycat/db/VerifyConfig.html" title="class in com.sleepycat.db">VerifyConfig</A> verifyConfig, |
| 2108 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> dbConfig) |
| 2109 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A>, |
| 2110 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></PRE> |
| 2111 |
<DL> |
| 2112 |
<DD>Return if all of the databases in a file are uncorrupted. |
| 2113 |
<p> |
| 2114 |
This method optionally outputs the databases' key/data pairs to a |
| 2115 |
file stream. |
| 2116 |
<p> |
| 2117 |
<b> |
| 2118 |
This method does not perform any locking, even in database |
| 2119 |
environments are configured with a locking subsystem. As such, it |
| 2120 |
should only be used on files that are not being modified by another |
| 2121 |
thread of control. |
| 2122 |
</b> |
| 2123 |
<p> |
| 2124 |
This method may not be called after the database is opened. |
| 2125 |
<p> |
| 2126 |
If the database was opened within a database environment, the |
| 2127 |
environment variable DB_HOME may be used as the path of the database |
| 2128 |
environment home. |
| 2129 |
<p> |
| 2130 |
This method is affected by any database directory specified with |
| 2131 |
<A HREF="../../../com/sleepycat/db/EnvironmentConfig.html#addDataDir(java.io.File)"><CODE>EnvironmentConfig.addDataDir</CODE></A>, or by setting the "set_data_dir" |
| 2132 |
string in the database environment's DB_CONFIG file. |
| 2133 |
<p> |
| 2134 |
The <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> handle may not be accessed |
| 2135 |
again after this method is called, regardless of this method's success |
| 2136 |
or failure. |
| 2137 |
<p> |
| 2138 |
<P> |
| 2139 |
<DD><DL> |
| 2140 |
<DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The physical file in which the databases to be verified are found. |
| 2141 |
<p><DD><CODE>databaseName</CODE> - The database in the file on which the database checks for btree and |
| 2142 |
duplicate sort order and for hashing are to be performed. This |
| 2143 |
parameter should be set to null except when the operation has been |
| 2144 |
been configured by <A HREF="../../../com/sleepycat/db/VerifyConfig.html#setOrderCheckOnly(boolean)"><CODE>VerifyConfig.setOrderCheckOnly</CODE></A>. |
| 2145 |
<p><DD><CODE>dumpStream</CODE> - An optional file stream to which the databases' key/data pairs are |
| 2146 |
written. This parameter should be set to null except when the |
| 2147 |
operation has been been configured by <A HREF="../../../com/sleepycat/db/VerifyConfig.html#setSalvage(boolean)"><CODE>VerifyConfig.setSalvage</CODE></A>. |
| 2148 |
<p><DD><CODE>verifyConfig</CODE> - The verify operation attributes. If null, default attributes are used. |
| 2149 |
<p><DD><CODE>dbConfig</CODE> - The database attributes. If null, default attributes are used. |
| 2150 |
<p> |
| 2151 |
<DT><B>Returns:</B><DD>True, if all of the databases in the file are uncorrupted. If this |
| 2152 |
method returns false, and the operation was configured by |
| 2153 |
<A HREF="../../../com/sleepycat/db/VerifyConfig.html#setSalvage(boolean)"><CODE>VerifyConfig.setSalvage</CODE></A>, all of the key/data pairs in the |
| 2154 |
file may not have been successfully output. |
| 2155 |
<p> |
| 2156 |
<p> |
| 2157 |
<DT><B>Throws:</B> |
| 2158 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - if a failure occurs. |
| 2159 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</A></CODE></DL> |
| 2160 |
</DD> |
| 2161 |
</DL> |
| 2162 |
|
| 2163 |
<HR> |
| 2164 |
|
| 2165 |
|
| 2166 |
|
| 2167 |
<A NAME="navbar_bottom"></A> |
| 2168 |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| 2169 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 2170 |
<TR> |
| 2171 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 2172 |
<A NAME="navbar_bottom_firstrow"></A> |
| 2173 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 2174 |
<TR ALIGN="center" VALIGN="top"> |
| 2175 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 2176 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 2177 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 2178 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Database.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 2179 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 2180 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 2181 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 2182 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 2183 |
</TR> |
| 2184 |
</TABLE> |
| 2185 |
</TD> |
| 2186 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 2187 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 2188 |
</TD> |
| 2189 |
</TR> |
| 2190 |
|
| 2191 |
<TR> |
| 2192 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 2193 |
<A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A> |
| 2194 |
<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD> |
| 2195 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 2196 |
<A HREF="../../../index.html?com/sleepycat/db/Database.html" target="_top"><B>FRAMES</B></A> |
| 2197 |
<A HREF="Database.html" target="_top"><B>NO FRAMES</B></A> |
| 2198 |
<SCRIPT type="text/javascript"> |
| 2199 |
<!-- |
| 2200 |
if(window==top) { |
| 2201 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 2202 |
} |
| 2203 |
//--> |
| 2204 |
</SCRIPT> |
| 2205 |
<NOSCRIPT> |
| 2206 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 2207 |
</NOSCRIPT> |
| 2208 |
|
| 2209 |
|
| 2210 |
</FONT></TD> |
| 2211 |
</TR> |
| 2212 |
<TR> |
| 2213 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 2214 |
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 2215 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 2216 |
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 2217 |
</TR> |
| 2218 |
</TABLE> |
| 2219 |
<A NAME="skip-navbar_bottom"></A> |
| 2220 |
|
| 2221 |
|
| 2222 |
<HR> |
| 2223 |
<font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font> |
| 2224 |
</BODY> |
| 2225 |
</HTML> |