You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/hello-world/pages/start-using-sdk.adoc
+37-35Lines changed: 37 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,34 +24,35 @@ In this guide, you will learn:
24
24
25
25
== Hello Couchbase
26
26
27
-
We will go through the code sample step by step, but for those in a hurry to see it, here it is:
27
+
We will go through the code sample step by step, but for those in a hurry, here's the complete code:
28
28
29
-
[{tabs}]
29
+
[{tabs}]
30
30
====
31
31
Couchbase Capella Sample::
32
32
+
33
33
--
34
-
If you are connecting to https://docs.couchbase.com/cloud/index.html[Couchbase Capella], be sure to get the correct endpoint as well as user, password.
34
+
If you are connecting to https://docs.couchbase.com/cloud/index.html[Couchbase Capella], you'll need to know the endpoint address, as well as a username and password.
35
+
36
+
This example requires the Travel Sample Bucket.
37
+
The Couchbase Capella free trial version comes with this bucket, and its Query indexes, loaded and ready.
From version 3.3, the Java SDK includes Capella’s standard certificates by default, so you don't need any additional configuration.
197
-
You do need to enable TLS, which can be done by simply using `couchbases://` in the connection string as in this example.
192
+
From version 3.3, the Java SDK includes Capella’s standard Certificate Authority (CA) certificates by default, so you don't need any additional configuration.
193
+
Capella requires TLS, which you can enable by using a connection string that starts with `couchbases://` (note the final 's').
198
194
199
-
Alternatively, you can use a xref:howtos:managing-connections.adoc#cluster-environment[Cluster Environment] when you need to customize the client’s behavior (e.g. changing connection timeout settings).
195
+
This example shows how to connect and customize the xref:howtos:managing-connections.adoc#cluster-environment[Cluster Environment] settings.
When accessing Capella from a different Wide Area Network or Availability Zone, you may experience latency issues with the default connection settings.
@@ -213,28 +209,34 @@ CAUTION: The Configuration Profiles feature is currently a xref:java-sdk:project
213
209
Local Couchbase Server::
214
210
+
215
211
--
212
+
For developing locally on the same machine as Couchbase Server, your connection string can be `couchbase://127.0.0.1` as shown here.
213
+
For production deployments, you will want to enable TLS by using `couchbases://` (note the final 's') instead of `couchbase://`.
214
+
215
+
This example shows how to connect and customize the xref:howtos:managing-connections.adoc#cluster-environment[Cluster Environment] settings.
For developing locally on the same machine as Couchbase Server, your URI can be `couchbase://localhost` as shown here.
222
-
For production deployments, you will want to use a secure server, with `couchbases://`.
223
-
224
-
Alternatively, you can use a xref:howtos:managing-connections.adoc#cluster-environment[Cluster Environment] when you need to customize the client’s behavior (e.g. changing connection timeout settings).
224
+
[TIP]
225
+
.Simpler Connection
226
+
====
227
+
There's also a simpler version of `Cluster.connect()` for when you don't need to customize the cluster environment:
xref:howtos:kv-operations.adoc[Data operations], like storing and retrieving documents, can be done using simple methods on the `Collection` class such as `Collection.get()` and `Collection.upsert()`.
@@ -255,7 +257,7 @@ Add the following code to create a new document and retrieve it:
0 commit comments