| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 |
<title>Berkeley DB Collections Tutorial</title> |
| 7 |
<link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 |
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 |
<link rel="start" href="index.html" title="Berkeley DB Collections Tutorial" /> |
| 10 |
<link rel="next" href="preface.html" title="Preface" /> |
| 11 |
</head> |
| 12 |
<body> |
| 13 |
<div xmlns="" class="navheader"> |
| 14 |
<div class="libver"> |
| 15 |
<p>Library Version 11.2.5.3</p> |
| 16 |
</div> |
| 17 |
<table width="100%" summary="Navigation header"> |
| 18 |
<tr> |
| 19 |
<th colspan="3" align="center">Berkeley DB Collections Tutorial</th> |
| 20 |
</tr> |
| 21 |
<tr> |
| 22 |
<td width="20%" align="left"> </td> |
| 23 |
<th width="60%" align="center"> </th> |
| 24 |
<td width="20%" align="right"> <a accesskey="n" href="preface.html">Next</a></td> |
| 25 |
</tr> |
| 26 |
</table> |
| 27 |
<hr /> |
| 28 |
</div> |
| 29 |
<div class="book" lang="en" xml:lang="en"> |
| 30 |
<div class="titlepage"> |
| 31 |
<div> |
| 32 |
<div> |
| 33 |
<h1 class="title"><a id="idm851872"></a>Berkeley DB Collections Tutorial</h1> |
| 34 |
</div> |
| 35 |
<div> |
| 36 |
<div class="legalnotice"> |
| 37 |
<a id="idp50412752"></a> |
| 38 |
<p class="legalnotice-title"> |
| 39 |
<b>Legal Notice</b> |
| 40 |
</p> |
| 41 |
<span> |
| 42 |
<p> |
| 43 |
This documentation is distributed under an open source license. |
| 44 |
You may review the terms of this license at: |
| 45 |
<a class="ulink" href="http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html" target="_top">http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html</a> |
| 46 |
|
| 47 |
|
| 48 |
</p> |
| 49 |
|
| 50 |
<p> |
| 51 |
Oracle, Berkeley DB, |
| 52 |
|
| 53 |
|
| 54 |
and |
| 55 |
Sleepycat are trademarks or registered trademarks of |
| 56 |
Oracle. All rights to these marks are reserved. |
| 57 |
No third-party use is permitted without the |
| 58 |
express prior written consent of Oracle. |
| 59 |
</p> |
| 60 |
<p> |
| 61 |
<span class="trademark">Java</span>™ and all Java-based marks are a trademark |
| 62 |
or registered trademark of Sun Microsystems, |
| 63 |
Inc, in the United States and other countries. |
| 64 |
</p> |
| 65 |
<p> |
| 66 |
Other names may be trademarks of their respective owners. |
| 67 |
</p> |
| 68 |
<p> |
| 69 |
To obtain a copy of this document's original source code, please |
| 70 |
submit a request to the Oracle Technology Network forum at: |
| 71 |
<a class="ulink" href="http://forums.oracle.com/forums/forum.jspa?forumID=271" target="_top">http://forums.oracle.com/forums/forum.jspa?forumID=271</a> |
| 72 |
|
| 73 |
|
| 74 |
</p> |
| 75 |
</span> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
<div> |
| 79 |
<p class="pubdate">9/9/2013</p> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
<hr /> |
| 83 |
</div> |
| 84 |
<div class="toc"> |
| 85 |
<p> |
| 86 |
<b>Table of Contents</b> |
| 87 |
</p> |
| 88 |
<dl> |
| 89 |
<dt> |
| 90 |
<span class="preface"> |
| 91 |
<a href="preface.html">Preface</a> |
| 92 |
</span> |
| 93 |
</dt> |
| 94 |
<dd> |
| 95 |
<dl> |
| 96 |
<dt> |
| 97 |
<span class="sect1"> |
| 98 |
<a href="preface.html#conventions">Conventions Used in this Book</a> |
| 99 |
</span> |
| 100 |
</dt> |
| 101 |
<dt> |
| 102 |
<span class="sect1"> |
| 103 |
<a href="moreinfo.html">For More Information</a> |
| 104 |
</span> |
| 105 |
</dt> |
| 106 |
<dd> |
| 107 |
<dl> |
| 108 |
<dt> |
| 109 |
<span class="sect2"> |
| 110 |
<a href="moreinfo.html#contact_us">Contact Us</a> |
| 111 |
</span> |
| 112 |
</dt> |
| 113 |
</dl> |
| 114 |
</dd> |
| 115 |
</dl> |
| 116 |
</dd> |
| 117 |
<dt> |
| 118 |
<span class="chapter"> |
| 119 |
<a href="intro.html">1. |
| 120 |
Introduction |
| 121 |
</a> |
| 122 |
</span> |
| 123 |
</dt> |
| 124 |
<dd> |
| 125 |
<dl> |
| 126 |
<dt> |
| 127 |
<span class="sect1"> |
| 128 |
<a href="intro.html#features">Features</a> |
| 129 |
</span> |
| 130 |
</dt> |
| 131 |
<dt> |
| 132 |
<span class="sect1"> |
| 133 |
<a href="developing.html">Developing a DB Collections Application</a> |
| 134 |
</span> |
| 135 |
</dt> |
| 136 |
<dt> |
| 137 |
<span class="sect1"> |
| 138 |
<a href="tutorialintroduction.html">Tutorial Introduction</a> |
| 139 |
</span> |
| 140 |
</dt> |
| 141 |
</dl> |
| 142 |
</dd> |
| 143 |
<dt> |
| 144 |
<span class="chapter"> |
| 145 |
<a href="BasicProgram.html">2. |
| 146 |
The Basic Program |
| 147 |
</a> |
| 148 |
</span> |
| 149 |
</dt> |
| 150 |
<dd> |
| 151 |
<dl> |
| 152 |
<dt> |
| 153 |
<span class="sect1"> |
| 154 |
<a href="BasicProgram.html#keyandvalueclasses"> |
| 155 |
Defining Serialized Key and Value Classes |
| 156 |
</a> |
| 157 |
</span> |
| 158 |
</dt> |
| 159 |
<dt> |
| 160 |
<span class="sect1"> |
| 161 |
<a href="opendbenvironment.html"> |
| 162 |
Opening and Closing the Database Environment |
| 163 |
</a> |
| 164 |
</span> |
| 165 |
</dt> |
| 166 |
<dt> |
| 167 |
<span class="sect1"> |
| 168 |
<a href="openclasscatalog.html"> |
| 169 |
Opening and Closing the Class Catalog |
| 170 |
</a> |
| 171 |
</span> |
| 172 |
</dt> |
| 173 |
<dt> |
| 174 |
<span class="sect1"> |
| 175 |
<a href="opendatabases.html"> |
| 176 |
Opening and Closing Databases |
| 177 |
</a> |
| 178 |
</span> |
| 179 |
</dt> |
| 180 |
<dt> |
| 181 |
<span class="sect1"> |
| 182 |
<a href="createbindingscollections.html"> |
| 183 |
Creating Bindings and Collections |
| 184 |
</a> |
| 185 |
</span> |
| 186 |
</dt> |
| 187 |
<dt> |
| 188 |
<span class="sect1"> |
| 189 |
<a href="implementingmain.html"> |
| 190 |
Implementing the Main Program |
| 191 |
</a> |
| 192 |
</span> |
| 193 |
</dt> |
| 194 |
<dt> |
| 195 |
<span class="sect1"> |
| 196 |
<a href="usingtransactions.html"> |
| 197 |
Using Transactions |
| 198 |
</a> |
| 199 |
</span> |
| 200 |
</dt> |
| 201 |
<dt> |
| 202 |
<span class="sect1"> |
| 203 |
<a href="addingdatabaseitems.html"> |
| 204 |
Adding Database Items |
| 205 |
</a> |
| 206 |
</span> |
| 207 |
</dt> |
| 208 |
<dt> |
| 209 |
<span class="sect1"> |
| 210 |
<a href="retrievingdatabaseitems.html"> |
| 211 |
Retrieving Database Items |
| 212 |
</a> |
| 213 |
</span> |
| 214 |
</dt> |
| 215 |
<dt> |
| 216 |
<span class="sect1"> |
| 217 |
<a href="handlingexceptions.html"> |
| 218 |
Handling Exceptions |
| 219 |
</a> |
| 220 |
</span> |
| 221 |
</dt> |
| 222 |
</dl> |
| 223 |
</dd> |
| 224 |
<dt> |
| 225 |
<span class="chapter"> |
| 226 |
<a href="UsingSecondaries.html">3. |
| 227 |
Using Secondary Indices |
| 228 |
</a> |
| 229 |
</span> |
| 230 |
</dt> |
| 231 |
<dd> |
| 232 |
<dl> |
| 233 |
<dt> |
| 234 |
<span class="sect1"> |
| 235 |
<a href="UsingSecondaries.html#opensecondaryindices"> |
| 236 |
Opening Secondary Key Indices |
| 237 |
</a> |
| 238 |
</span> |
| 239 |
</dt> |
| 240 |
<dt> |
| 241 |
<span class="sect1"> |
| 242 |
<a href="openingforeignkeys.html"> |
| 243 |
|
| 244 |
<span>More Secondary Key Indices</span> |
| 245 |
</a> |
| 246 |
</span> |
| 247 |
</dt> |
| 248 |
<dt> |
| 249 |
<span class="sect1"> |
| 250 |
<a href="indexedcollections.html"> |
| 251 |
Creating Indexed Collections |
| 252 |
</a> |
| 253 |
</span> |
| 254 |
</dt> |
| 255 |
<dt> |
| 256 |
<span class="sect1"> |
| 257 |
<a href="retrievingbyindexkey.html"> |
| 258 |
Retrieving Items by Index Key |
| 259 |
</a> |
| 260 |
</span> |
| 261 |
</dt> |
| 262 |
</dl> |
| 263 |
</dd> |
| 264 |
<dt> |
| 265 |
<span class="chapter"> |
| 266 |
<a href="Entity.html">4. |
| 267 |
Using Entity Classes |
| 268 |
</a> |
| 269 |
</span> |
| 270 |
</dt> |
| 271 |
<dd> |
| 272 |
<dl> |
| 273 |
<dt> |
| 274 |
<span class="sect1"> |
| 275 |
<a href="Entity.html#definingentityclasses"> |
| 276 |
Defining Entity Classes |
| 277 |
</a> |
| 278 |
</span> |
| 279 |
</dt> |
| 280 |
<dt> |
| 281 |
<span class="sect1"> |
| 282 |
<a href="creatingentitybindings.html"> |
| 283 |
Creating Entity Bindings |
| 284 |
</a> |
| 285 |
</span> |
| 286 |
</dt> |
| 287 |
<dt> |
| 288 |
<span class="sect1"> |
| 289 |
<a href="collectionswithentities.html"> |
| 290 |
Creating Collections with Entity Bindings |
| 291 |
</a> |
| 292 |
</span> |
| 293 |
</dt> |
| 294 |
<dt> |
| 295 |
<span class="sect1"> |
| 296 |
<a href="entitieswithcollections.html"> |
| 297 |
Using Entities with Collections |
| 298 |
</a> |
| 299 |
</span> |
| 300 |
</dt> |
| 301 |
</dl> |
| 302 |
</dd> |
| 303 |
<dt> |
| 304 |
<span class="chapter"> |
| 305 |
<a href="Tuple.html">5. |
| 306 |
Using Tuples |
| 307 |
</a> |
| 308 |
</span> |
| 309 |
</dt> |
| 310 |
<dd> |
| 311 |
<dl> |
| 312 |
<dt> |
| 313 |
<span class="sect1"> |
| 314 |
<a href="Tuple.html#tupleformat"> |
| 315 |
Using the Tuple Format |
| 316 |
</a> |
| 317 |
</span> |
| 318 |
</dt> |
| 319 |
<dt> |
| 320 |
<span class="sect1"> |
| 321 |
<a href="tupleswithkeycreators.html"> |
| 322 |
Using Tuples with Key Creators |
| 323 |
</a> |
| 324 |
</span> |
| 325 |
</dt> |
| 326 |
<dt> |
| 327 |
<span class="sect1"> |
| 328 |
<a href="tuplekeybindings.html"> |
| 329 |
Creating Tuple Key Bindings |
| 330 |
</a> |
| 331 |
</span> |
| 332 |
</dt> |
| 333 |
<dt> |
| 334 |
<span class="sect1"> |
| 335 |
<a href="tuple-serialentitybindings.html"> |
| 336 |
Creating Tuple-Serial Entity Bindings |
| 337 |
</a> |
| 338 |
</span> |
| 339 |
</dt> |
| 340 |
<dt> |
| 341 |
<span class="sect1"> |
| 342 |
<a href="sortedcollections.html"> |
| 343 |
Using Sorted Collections |
| 344 |
</a> |
| 345 |
</span> |
| 346 |
</dt> |
| 347 |
</dl> |
| 348 |
</dd> |
| 349 |
<dt> |
| 350 |
<span class="chapter"> |
| 351 |
<a href="SerializableEntity.html">6. |
| 352 |
Using Serializable Entities |
| 353 |
</a> |
| 354 |
</span> |
| 355 |
</dt> |
| 356 |
<dd> |
| 357 |
<dl> |
| 358 |
<dt> |
| 359 |
<span class="sect1"> |
| 360 |
<a href="SerializableEntity.html#transientfieldsinclass"> |
| 361 |
Using Transient Fields in an Entity Class |
| 362 |
</a> |
| 363 |
</span> |
| 364 |
</dt> |
| 365 |
<dt> |
| 366 |
<span class="sect1"> |
| 367 |
<a href="transientfieldsinbinding.html"> |
| 368 |
Using Transient Fields in an Entity Binding |
| 369 |
</a> |
| 370 |
</span> |
| 371 |
</dt> |
| 372 |
<dt> |
| 373 |
<span class="sect1"> |
| 374 |
<a href="removingredundantvalueclasses.html"> |
| 375 |
Removing the Redundant Value Classes |
| 376 |
</a> |
| 377 |
</span> |
| 378 |
</dt> |
| 379 |
</dl> |
| 380 |
</dd> |
| 381 |
<dt> |
| 382 |
<span class="chapter"> |
| 383 |
<a href="Summary.html">7. |
| 384 |
Summary |
| 385 |
</a> |
| 386 |
</span> |
| 387 |
</dt> |
| 388 |
<dt> |
| 389 |
<span class="appendix"> |
| 390 |
<a href="collectionOverview.html">A. |
| 391 |
API Notes and Details |
| 392 |
</a> |
| 393 |
</span> |
| 394 |
</dt> |
| 395 |
<dd> |
| 396 |
<dl> |
| 397 |
<dt> |
| 398 |
<span class="sect1"> |
| 399 |
<a href="collectionOverview.html#UsingDataBindings"> |
| 400 |
Using Data Bindings |
| 401 |
</a> |
| 402 |
</span> |
| 403 |
</dt> |
| 404 |
<dd> |
| 405 |
<dl> |
| 406 |
<dt> |
| 407 |
<span class="sect2"> |
| 408 |
<a href="collectionOverview.html#SelectingBindingFormats"> |
| 409 |
Selecting Binding Formats |
| 410 |
</a> |
| 411 |
</span> |
| 412 |
</dt> |
| 413 |
<dt> |
| 414 |
<span class="sect2"> |
| 415 |
<a href="collectionOverview.html#RecordNumberBindings">Record Number Bindings</a> |
| 416 |
</span> |
| 417 |
</dt> |
| 418 |
<dt> |
| 419 |
<span class="sect2"> |
| 420 |
<a href="collectionOverview.html#SelectingDataBindings"> |
| 421 |
Selecting Data Bindings |
| 422 |
</a> |
| 423 |
</span> |
| 424 |
</dt> |
| 425 |
<dt> |
| 426 |
<span class="sect2"> |
| 427 |
<a href="collectionOverview.html#ImplementingBindings"> |
| 428 |
Implementing Bindings |
| 429 |
</a> |
| 430 |
</span> |
| 431 |
</dt> |
| 432 |
<dt> |
| 433 |
<span class="sect2"> |
| 434 |
<a href="collectionOverview.html#UsingBindings"> |
| 435 |
Using Bindings |
| 436 |
</a> |
| 437 |
</span> |
| 438 |
</dt> |
| 439 |
<dt> |
| 440 |
<span class="sect2"> |
| 441 |
<a href="collectionOverview.html#SecondaryKeyCreators"> |
| 442 |
Secondary Key Creators |
| 443 |
</a> |
| 444 |
</span> |
| 445 |
</dt> |
| 446 |
</dl> |
| 447 |
</dd> |
| 448 |
<dt> |
| 449 |
<span class="sect1"> |
| 450 |
<a href="UsingCollectionsAPI.html"> |
| 451 |
Using the DB Java Collections API |
| 452 |
</a> |
| 453 |
</span> |
| 454 |
</dt> |
| 455 |
<dd> |
| 456 |
<dl> |
| 457 |
<dt> |
| 458 |
<span class="sect2"> |
| 459 |
<a href="UsingCollectionsAPI.html#UsingTransactions"> |
| 460 |
Using Transactions |
| 461 |
</a> |
| 462 |
</span> |
| 463 |
</dt> |
| 464 |
<dt> |
| 465 |
<span class="sect2"> |
| 466 |
<a href="UsingCollectionsAPI.html#TransactionRollback"> |
| 467 |
Transaction Rollback |
| 468 |
</a> |
| 469 |
</span> |
| 470 |
</dt> |
| 471 |
<dt> |
| 472 |
<span class="sect2"> |
| 473 |
<a href="UsingCollectionsAPI.html#SelectingAccessMethods">Selecting Access Methods</a> |
| 474 |
</span> |
| 475 |
</dt> |
| 476 |
<dt> |
| 477 |
<span class="sect2"> |
| 478 |
<a href="UsingCollectionsAPI.html#AccessMethodRestrictions"> |
| 479 |
Access Method Restrictions |
| 480 |
</a> |
| 481 |
</span> |
| 482 |
</dt> |
| 483 |
</dl> |
| 484 |
</dd> |
| 485 |
<dt> |
| 486 |
<span class="sect1"> |
| 487 |
<a href="UsingStoredCollections.html"> |
| 488 |
Using Stored Collections |
| 489 |
</a> |
| 490 |
</span> |
| 491 |
</dt> |
| 492 |
<dd> |
| 493 |
<dl> |
| 494 |
<dt> |
| 495 |
<span class="sect2"> |
| 496 |
<a href="UsingStoredCollections.html#StoredCollectionAccessMethods"> |
| 497 |
Stored Collection and Access Methods |
| 498 |
</a> |
| 499 |
</span> |
| 500 |
</dt> |
| 501 |
<dt> |
| 502 |
<span class="sect2"> |
| 503 |
<a href="UsingStoredCollections.html#StoredVersusStandardCollections"> |
| 504 |
Stored Collections Versus Standard Java Collections |
| 505 |
</a> |
| 506 |
</span> |
| 507 |
</dt> |
| 508 |
<dt> |
| 509 |
<span class="sect2"> |
| 510 |
<a href="UsingStoredCollections.html#StoredCollectionCharacteristics"> |
| 511 |
Other Stored Collection Characteristics |
| 512 |
</a> |
| 513 |
</span> |
| 514 |
</dt> |
| 515 |
<dt> |
| 516 |
<span class="sect2"> |
| 517 |
<a href="UsingStoredCollections.html#WhyJavaCollections"> |
| 518 |
Why Java Collections for Berkeley DB |
| 519 |
</a> |
| 520 |
</span> |
| 521 |
</dt> |
| 522 |
</dl> |
| 523 |
</dd> |
| 524 |
<dt> |
| 525 |
<span class="sect1"> |
| 526 |
<a href="SerializedObjectStorage.html"> |
| 527 |
Serialized Object Storage |
| 528 |
</a> |
| 529 |
</span> |
| 530 |
</dt> |
| 531 |
</dl> |
| 532 |
</dd> |
| 533 |
</dl> |
| 534 |
</div> |
| 535 |
</div> |
| 536 |
<div class="navfooter"> |
| 537 |
<hr /> |
| 538 |
<table width="100%" summary="Navigation footer"> |
| 539 |
<tr> |
| 540 |
<td width="40%" align="left"> </td> |
| 541 |
<td width="20%" align="center"> </td> |
| 542 |
<td width="40%" align="right"> <a accesskey="n" href="preface.html">Next</a></td> |
| 543 |
</tr> |
| 544 |
<tr> |
| 545 |
<td width="40%" align="left" valign="top"> </td> |
| 546 |
<td width="20%" align="center"> </td> |
| 547 |
<td width="40%" align="right" valign="top"> Preface</td> |
| 548 |
</tr> |
| 549 |
</table> |
| 550 |
</div> |
| 551 |
</body> |
| 552 |
</html> |