Library Version 18.1.25

Client Driver APIs
Prev | Chapter 1. Introduction to Building Distributed Applications with Berkeley DB | Next

## Client Driver APIs

The client driver APIs are modeled after Berkeley DB Java base APIs with most class names prefixed with an 'S', which stands for server. For example, the `Database` class is named the `SDatabase` class in the driver APIs. All classes in the client driver APIs are located in the `com.sleepycat.client` package.

In addition, the client driver provides the `BdbServerConnection` class, which can be used to establish a connection to a server and also serves as the starting point to everything else in the client driver APIs. For example, client environment handles are created like this:

    BdbServerConnection conn =
    		BdbServerConnection.connect("localhost", 8080);
    SEnvironment env = conn.openEnvironment("env",
    		new SEnvironmentConfig().setAllowCreate(true));

The `BdbServerConnection` class is not thread-safe. Furthermore, all objects created from a `BdbServerConnection` instance use the connection object internally. Thus, they must be accessed in the same thread as the connection object, or at least their accesses must be serialized. This rule applies recursively to handles created from environment handles (which are created from connection objects). Therefore, the entire object graph rooted at a single `BdbServerConnection` instance must be accessed in a single thread, or accessed serially.

Prev | Up | Next
Chapter 1. Introduction to Building Distributed Applications with Berkeley DB | Home | Secure Connections