Getting Started with Berkeley DB XML

for Java

Legal Notice

This documentation is distributed under the terms of the Sleepycat public license. You may review the terms of this license at: http://www.sleepycat.com/download/oslicense.html

Sleepycat Software, Berkeley DB, Berkeley DB XML and the Sleepycat logo are trademarks or service marks of Sleepycat Software, Inc. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Sleepycat Software, Inc.

Java™ and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc, in the United States and other countries.

To obtain a copy of this document's original source code, please write to .

12/5/2005


Table of Contents

Preface
Conventions Used in this Book
1. Introduction to Berkeley DB XML
Overview
Benefits
XML Features
Database Features
Languages and Platforms
Getting and Using BDB XML
Documentation and Support
Library Dependencies
Building and Running BDB XML Applications
2. Exception Handling and Debugging
Debugging BDB XML Applications
3. XmlManager and Containers
XmlManager
Berkeley DB Environments
XmlManager Instantiation and Destruction
Managing Containers
Container Properties
Container Types
Deleting and Renaming Containers
4. Adding XML Documents to Containers
Input Streams and Strings
Adding Documents
Setting Metadata
5. Using XQuery with BDB XML
XQuery: A Brief Introduction
Referencing Portions of Documents using XQuery
Predicates
Context
Wildcards
Navigation Functions
Using FLWOR with BDB XML
Retrieving BDB XML Documents using XQuery
The Query Context
Performing Queries
Examining Query Results
Examining Document Values
Examining Metadata
6. Managing Documents in Containers
Deleting Documents
Replacing Documents
Modifying XML Documents
Modification Parameters
Modification Methods
Modification Example
7. Using BDB XML Indices
Index Types
Uniqueness
Path Types
Node Types
Key Types
Syntax Types
Specifying Index Strategies
Using Strings to Specify Indices
Using Enumerated Types to Specify Indices
Specifying Index Nodes
Indexer Processing Notes
Managing BDB XML Indices
Adding Indices
Deleting Indices
Replacing Indices
Examining Container Indices
Working with Default Indices
Looking Up Indexed Documents
Verifying Indices using Query Plans
Query Plans
Using the dbxml Shell to Examine Query Plans
8. Using Transactions
Initializing the Transactional Subsystem
Transactionally Protecting Container Operations
Transactions Considerations
Transaction Disk I/O
Transaction and Lock Contention
Index Operations and Transactions

List of Examples

2.1. BDB XML Exception Handling
2.2. Setting Error Streams
2.3. Setting Log Levels
5.1. A Simple XML Document
5.2. XML Documents and Namespaces
5.3. Namespace Declaration
5.4. Namespace Prefixes
5.5. Namespaces with Attributes