Skip to content

Instantly share code, notes, and snippets.

@tgrall
Last active December 9, 2015 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgrall/4337487 to your computer and use it in GitHub Desktop.
Save tgrall/4337487 to your computer and use it in GitHub Desktop.
Connect to Couchbase Server
// import
import com.couchbase.client.CouchbaseClient;
...
...
List<URI> uris = new LinkedList<URI>();
uris.add(URI.create("http://127.0.0.1:8091/pools"));
CouchbaseClient client = null;
try {
client = new CouchbaseClient(uris, "default", "");
// put your code here
client.shutdown();
} catch (Exception e) {
System.err.println("Error connecting to Couchbase: " + e.getMessage());
System.exit(0);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment