Last active
December 9, 2015 22:28
-
-
Save tgrall/4337487 to your computer and use it in GitHub Desktop.
Connect to Couchbase Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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