Getting Started with Berkeley DB

Welcome to Berkeley DB (DB). This document introduces DB, version 4.5. It is intended to provide a rapid introduction to the DB API set and related concepts.

More PDF Content

Getting Started with Berkeley DB
Preface … iv
Conventions Used in this Book … iv
For More Information … v
1. Introduction to Berkeley DB … 1
About This Manual … 2
Berkeley DB Concepts … 2
Access Methods … 4
Selecting Access Methods … 4
Choosing between BTree and Hash … 5
Choosing between Queue and Recno … 5
Database Limits and Portability … 6
Environments … 6
Exception Handling … 7
Error Returns … 8
Getting and Using DB … 8
2. Databases … 9
Opening Databases … 9
Closing Databases … 10
Database Properties … 11
Administrative Methods … 12
Error Reporting Functions … 13
Managing Databases in Environments … 14
Database Example … 16
3. Database Records … 19
Using Database Records … 19
Reading and Writing Database Records … 20
Writing Records to the Database … 21
Getting Records from the Database … 22
Deleting Records … 23
Data Persistence … 24
Using the BIND APIs … 25
Numerical and String Objects … 25
Serializable Complex Objects … 27
Usage Caveats … 28
Serializing Objects … 28
Deserializing Objects … 31
Custom Tuple Bindings … 32
Database Usage Example … 35
4. Using Cursors … 47
Opening and Closing Cursors … 47
Getting Records Using the Cursor … 48
Searching for Records … 50
Working with Duplicate Records … 53
Putting Records Using Cursors … 55
Deleting Records Using Cursors … 57
Replacing Records Using Cursors … 58
Cursor Example … 59
5. Secondary Databases … 64
Opening and Closing Secondary Databases … 64
Implementing Key Creators … 67
Secondary Database Properties … 70
Reading Secondary Databases … 70
Deleting Secondary Database Records … 71
Using Secondary Cursors … 72
Database Joins … 73
Using Join Cursors … 74
JoinCursor Properties … 76
Secondary Database Example … 77
Opening Secondary Databases with MyDbs … 78
Using Secondary Databases with ExampleDatabaseRead … 82
6. Database Configuration … 85
Setting the Page Size … 85
Overflow Pages … 85
Locking … 86
IO Efficiency … 87
Page Sizing Advice … 87
Selecting the Cache Size … 88
BTree Configuration … 88
Allowing Duplicate Records … 89
Sorted Duplicates … 89
Unsorted Duplicates … 89
Configuring a Database to Support Duplicates … 90
Setting Comparison Functions … 91
Creating Java Comparators … 92

Download Getting Started with Berkeley DB pdf from sewm.pku.edu.cn, 100 pages, 480.03KB.
Related Books

Leave a Reply