Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: Java 1.1
Community Wiki and Resources
Download Client Library
JavaDoc
Couchbase Developer Guide 2.0
Couchbase Server Manual 2.0
Java Client Library
SDK Forum
Wiki: Java Client Library
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
Couchbase Client Library: Java 1.1
Child Sections
Chapters

Chapter 1. Getting Started

Table of Contents

1.1. Preparations
1.1.1. Downloading the Couchbase Client Libraries
1.1.2. Setting up your IDE
1.2. Hello Couchbase
1.3. Working with Documents
1.3.1. Creating and Updating Documents
1.3.2. Reading Documents
1.3.3. Deleting Documents
1.3.4. JSON Encoding/Decoding
1.4. Advanced Topics
1.4.1. CAS and Locking
1.4.2. Persistence and Replication
1.4.3. View Queries with ComplexKeys
1.5. Next Steps

Awesome that you want to learn more about Couchbase! This is the right place to start your journey. This chapter will teach you the basics of Couchbase and how to interact with it through the Java Client SDK.

If you haven't already, download the latest Couchbase Server 2.0 release and install it. While following the download instructions and setup wizard, make sure install the beer-sample default bucket. It contains sample data of beers and breweries, which we'll be using in our examples here. If you've already installed Couchbase Server 2.0 and didn't install the beer-sample bucket (or if you deleted it), just open the Web-UI and navigate to Settings/Sample Buckets. Activate the beer-sample checkbox and click Create. In the right hand corner you'll see a notification box that will disappear once the bucket is ready to be used.

Here's a quick outline of what you'll learn in this chapter:

  1. Create a project in your favorite IDE and set up the dependencies.

  2. Write a simple program to demonstrate connecting to Couchbase and saving some documents.

  3. Write a program to demonstrate using Create, Read, Update, Delete (CRUD) operations on documents in combination with JSON serialization and deserialization.

  4. Explore some of the API methods that will take you further than what you've seen previously.

From here on, we'll assume that you have a Couchbase Server 2.0 release running and the "beer-sample" bucket configured. If you need any help on setting up everything, there is plenty of documentation available:

Warning

The TCP/IP port allocation on Windows by default includes a restricted number of ports available for client communication. For more information on this issue, including information on how to adjust the configuration and increase the available ports, see MSDN: Avoiding TCP/IP Port Exhaustion.