{"id":12222,"date":"2021-10-07T00:00:30","date_gmt":"2021-10-07T07:00:30","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=12222"},"modified":"2025-06-13T18:43:19","modified_gmt":"2025-06-14T01:43:19","slug":"couchbase-java-developer-walkthrough","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-java-developer-walkthrough\/","title":{"rendered":"Couchbase + Java \uc2dc\uc791\ud558\uae30 [\uac1c\ubc1c\uc790 \uc6cc\ud06c\uc2a4\ub8e8]"},"content":{"rendered":"<p><strong>\ub2e4\uc74c\uacfc \uac19\uc740 \uac1c\ubc1c\uc790\uc778 \uacbd\uc6b0<\/strong> Couchbase\ub97c \ucc98\uc74c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0 \uc774 \ubb38\uc11c\uac00 \uc2dc\uc791\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub429\ub2c8\ub2e4.<\/p>\n<p>\uc774 \uc8fc\uac04 \uc5f0\uc2b5 \uc2dc\ub9ac\uc988\ub294 CouchBase \uc5f0\uacb0\uc758 \uae30\ubcf8 \uc0ac\ud56d\uc744 \uc774\ud574\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub418\uba70, CouchBase Server\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac80\uc0c9\ud558\uace0 \uc218\uc815\ud558\ub294 \ubc29\ubc95, \ub2e4\uc74c\uc744 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \ubcf4\uc5ec \uc90d\ub2c8\ub2e4. <a href=\"https:\/\/query-tutorial.couchbase.com\/tutorial\/?ref=blog\/#1\" target=\"_blank\" rel=\"noopener\">SQL++ \ucffc\ub9ac \uc5b8\uc5b4<\/a> (\uc774\uc804\uc758 N1QL) \ub4f1\uc744 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4. \uc774\ubc88 \uc8fc\uc5d0\ub294 \uc608\uc81c \ucf54\ub4dc\uc5d0 Java\uac00 \ub4f1\uc7a5\ud558\uba70, Couchbase Java SDK\ub97c \uc0ac\uc6a9\ud560 \uc608\uc815\uc785\ub2c8\ub2e4.<\/p>\n<p><a href=\"https:\/\/developer.couchbase.com\/new-to-couchbase\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4<\/a> \ub294 \ubd84\uc0b0\ud615\uc785\ub2c8\ub2e4, <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/json-database\/?ref=blog\" target=\"_blank\" rel=\"noopener\">JSON \ubb38\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4<\/a>. \ubc00\ub9ac\ucd08 \ubbf8\ub9cc\uc758 \ub370\uc774\ud130 \uc791\uc5c5\uc744 \uc704\ud55c \uad00\ub9ac\ud615 \uce90\uc2dc\ub97c \uac16\ucd98 \uc2a4\ucf00\uc77c\uc544\uc6c3 \ud0a4-\uac12 \uc800\uc7a5\uc18c, \ud6a8\uc728\uc801\uc778 \ucffc\ub9ac\ub97c \uc704\ud55c \ud2b9\uc218 \uc81c\uc791\ub41c \uc778\ub371\uc11c, SQL\uacfc \uc720\uc0ac\ud55c \ucffc\ub9ac\ub97c \uc2e4\ud589\ud558\uae30 \uc704\ud55c \uac15\ub825\ud55c \ucffc\ub9ac \uc5d4\uc9c4\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/p>\n<p>In this developer walkthrough, we will look at the basic features of Couchbase \u2013 both through a non-relational JSON interface and relational SQL interface. Couchbase ships with a sample database, `travel-sample`, and we&#8217;ll use this sample dataset to learn Couchbase fundamentals using the Java SDK.<\/p>\n<h2>\uc5ec\ud589 \uc0d8\ud50c \ub370\uc774\ud130 \uc138\ud2b8 \uc774\ud574<\/h2>\n<p>In order to gain a better understanding of what the `travel-sample` dataset looks like, feel free to <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/ref\/travel-app-data-model.html?ref=blog\" target=\"_blank\" rel=\"noopener\">Java SDK \ubb38\uc11c\uc5d0\uc11c \uc774\uc5d0 \ub300\ud574 \uc77d\uc5b4\ubcf4\uc138\uc694: \uc5ec\ud589 \uc571 \ub370\uc774\ud130 \ubaa8\ub378<\/a>.<\/p>\n<p>Below is an entity-relationship diagram of the `travel-sample` dataset along with an accompanying data model:<\/p>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12226\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase.png\" alt=\"The Couchbase travel-sample dataset in an E-R diagram\" width=\"1000\" height=\"960\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase.png 1000w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase-300x288.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase-768x737.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/travel-sample-entity-relationship-diagram-couchbase-20x20.png 20w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/json-document-data-model.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12225\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/json-document-data-model.png\" alt=\"A JSON document data model in Couchbase\" width=\"538\" height=\"490\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/json-document-data-model.png 538w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/json-document-data-model-300x273.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/json-document-data-model-20x18.png 20w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/a><\/p>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\ud0a4-\uac12 \uac00\uc838\uc624\uae30 \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uac80\uc0c9\ud558\ub294 \ubc29\ubc95<\/h2>\n<p>\ud0a4-\uac12(\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ub370\uc774\ud130 \uc11c\ube44\uc2a4\ub77c\uace0\ub3c4 \ud568)\uc740 \ud0a4\ub97c \uc54c\uace0 \uc788\ub294 \ub370\uc774\ud130\ub97c \uac80\uc0c9\ud558\uac70\ub098 \ubcc0\uacbd\ud558\ub294 \uac00\uc7a5 \uac04\ub2e8\ud55c \ubc29\ubc95\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \ud0a4-\uac12 \uc800\uc7a5\uc18c\ub294 \uc77c\uc885\uc758 <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/resources\/why-nosql\/?ref=blog\" target=\"_blank\" rel=\"noopener\">NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4<\/a> \ud0a4\uac00 \uace0\uc720 \uc2dd\ubcc4\uc790 \uc5ed\ud560\uc744 \ud558\ub294 \ud0a4-\uac12 \uc30d\uc758 \ubaa8\uc74c\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \uac04\ub2e8\ud55c \ubc29\ubc95\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/products\/server\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \uc11c\ubc84<\/a> is a key-value store that&#8217;s agnostic to what&#8217;s stored. The example below shows you how to use the key-value `get` function in order to retrieve data from a backend.<\/p>\n<p>\uacc4\uc18d \uc9c4\ud589\ud558\uae30 \uc804\uc5d0 \uc778\uc99d \ubc0f Couchbase \ud074\ub7ec\uc2a4\ud130 \uc5f0\uacb0\uc5d0 \ub300\ud55c \uae30\ubcf8 \uc0ac\ud56d\uc744 \uc219\uc9c0\ud558\uace0 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uc138\uc694. <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/hello-world\/start-using-sdk.html?ref=blog\" target=\"_blank\" rel=\"noopener\">Couchbase \uc124\uba85\uc11c\uc758 \"Java SDK \uc0ac\uc6a9 \uc2dc\uc791\" \uc139\uc158\uc744 \uc77d\uc5b4\ubcf4\uc138\uc694.<\/a> \ub97c \ud074\ub9ad\ud558\uc138\uc694.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c \uc138 \uac00\uc9c0 \uac00\uc838\uc624\uae30\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.DocumentNotFoundException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\nimport com.couchbase.client.java.kv.*;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\ub2e4\uc74c\uc73c\ub85c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. Java\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc73c\ubbc0\ub85c \uba3c\uc800 \ud074\ub798\uc2a4\uc640 \uba54\uc778 \uba54\uc11c\ub4dc\ub97c \uc120\uc5b8\ud574\uc57c \ud569\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c \ud074\ub7ec\uc2a4\ud130\uc5d0 \ub300\ud55c \ubcc0\uc218\ub97c \ub9cc\ub4ed\ub2c8\ub2e4.<\/p>\n<p>In the example below, `cluster` is the name of the variable of type `var`. Using a connection string, have your program connect with the data in the backend. A Couchbase connection string is a comma-delimited list of IP addresses and\/or hostnames, optionally followed by a list of parameters. Below, `couchbase:\/\/127.0.0.1` is a simple connection string with one seed node followed by a username and password. Be sure to replace all this information with information relative to your program.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>Couchbase Server \ud074\ub7ec\uc2a4\ud130\uc5d0 \ub300\ud55c \uc5f0\uacb0\uc740 \ud074\ub7ec\uc2a4\ud130 \uac1c\uccb4\ub85c \ud45c\uc2dc\ub429\ub2c8\ub2e4. \ud074\ub7ec\uc2a4\ud130\ub294 \ubc84\ud0b7\uc5d0 \ub300\ud55c \uc561\uc138\uc2a4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4, <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/scopes-and-collections-for-modern-multi-tenant-applications-couchbase-7-0\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\ubc94\uc704 \ubc0f \uceec\ub809\uc158<\/a>\ubfd0\ub9cc \uc544\ub2c8\ub77c \ub2e4\uc591\ud55c Couchbase \uc11c\ube44\uc2a4 \ubc0f \uad00\ub9ac \uc778\ud130\ud398\uc774\uc2a4\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc704\uc5d0 \uc5f0\uacb0 \ubb38\uc790\uc5f4, \uc0ac\uc6a9\uc790 \uc774\ub984, \ube44\ubc00\ubc88\ud638\ub97c \uc785\ub825\ud558\uba74 Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uace0 \uc774\uc81c Couchbase \ubc84\ud0b7 \ubc0f \uceec\ub809\uc158\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n    var collection = bucket.defaultCollection();\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>The Java `get` method allows you to retrieve a certain piece of data. Given a document&#8217;s key, you can use the `collection.get()` method to retrieve a document from a collection.<\/p>\n<p>In this example, you&#8217;re retrieving the content in the collection named `&#8221;airline_10&#8243;` in the database. Then, in order to see the result, there is a `print` statement which allows you to finish retrieving the data.<\/p>\n<pre>      try {\r\n        var result = collection.get(\"airline_10\");\r\n        System.out.println(result.toString());\r\n          }\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>Lastly, just in case the user tries to retrieve a piece of information that does not exist or is not within the bounds of the document, there is a `catch` exception to make sure there are no errors in the code.<\/p>\n<pre>      catch (DocumentNotFoundException ex) {\r\n      System.out.println(\"Document not found!\");\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\ucffc\ub9ac \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \uac80\uc0c9\ud558\uae30<\/h2>\n<p>A query is always performed at the cluster level, specifically using the `query` method. This method takes the statement as a required argument and then allows it to provide additional options if needed.<\/p>\n<p>Once a result returns you can iterate the returned rows and\/or access the `QueryMetaData` associated with the query. If something goes wrong during the execution of the query, a derivative of the `CouchbaseException` is thrown that also provides additional context on the operation.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 5\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.DocumentNotFoundException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\nimport com.couchbase.client.java.kv.*;\r\nimport com.couchbase.client.java.json.JsonObject;\r\ncom.couchbase.client.java.query.QueryResult\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>This is an example of performing a query and handling the results. The result that prints is `&#8221;Hotel: &#8220;` followed by the name, city, state and other information specific to the hotel. Only up to five rows will be printed since that is the number limit represented in the code. In order to test out different queries, try changing the name of the city in line six to any other city.<\/p>\n<pre> try {\r\n      var query = \r\n        \"SELECT h.name, h.city, h.state \" +\r\n        \"FROM `travel-sample` h \" +\r\n        \"WHERE h.type = 'hotel' \" +\r\n          \"AND h.city = 'Malibu' LIMIT 5;\";\r\n\r\n      QueryResult result = cluster.query(query);\r\n      for (JsonObject row : result.rowsAsObject()) {\r\n        System.out.println(\"Hotel: \" + row);\r\n      }\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As before, the `catch` exception ensures there are no errors in your code. For example, if you chose a city that your database doesn&#8217;t have, this `DocumentNotFoundException` exception will print `&#8221;Document not found!&#8221;`.<\/p>\n<pre>     } catch (DocumentNotFoundException ex) {\r\n      System.out.println(\"Document not found!\");\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\ub85c \ucffc\ub9ac\ud558\ub294 \ubc29\ubc95<\/h2>\n<p>\uc55e\uc11c \uc5b8\uae09\ud588\ub4ef\uc774 \ucffc\ub9ac \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uba74 \ud2b9\uc815 \uae30\uc900\uc5d0 \ub530\ub77c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \ud2b9\uc815 \uc815\ubcf4\ub97c \uac80\uc0c9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac \uba54\uc11c\ub4dc\uc5d0\ub294 \uc774\ub984 \ub610\ub294 \uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774 \uc139\uc158\uc5d0\uc11c\ub294 \uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\uac00 \ubb34\uc5c7\uc774\uba70 \ub9e4\uac1c\ubcc0\uc218\uac00 \ub9ce\uc740 \uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud560 \ub54c \uc5b4\ub5bb\uac8c \uc720\uc6a9\ud55c\uc9c0 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4. \uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\ub294 \uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud560 \ub54c \ub9e4\uac1c\ubcc0\uc218\uc758 \uc774\ub984\uc744 \uba85\ud655\ud558\uac8c \uba85\uc2dc\ud569\ub2c8\ub2e4. \uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\ub97c \uc0ac\uc6a9\ud558\uba74 \uc0ac\uc6a9\uc790\uac00 \uc784\uc758\uc758 \ud558\uc704 \uc9d1\ud569\uc744 \uc0ac\uc6a9\ud558\uc5ec \uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud560 \uc218 \uc788\uc73c\uba70 \ub098\uba38\uc9c0 \ub9e4\uac1c\ubcc0\uc218\ub294 \uae30\ubcf8\uac12\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 7\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.CouchbaseException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\nimport com.couchbase.client.java.kv.*;\r\nimport com.couchbase.client.java.json.JsonObject;\r\ncom.couchbase.client.java.query.QueryResult\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\ncom.couchbase.client.java.query.QueryOptions\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.query.QueryOptions.queryOptions\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>The code proceeds to access the `travel-sample` database and specifically the name, city and state buckets. The `queryOptions()` method allows the customization of various SQL++ query options.<\/p>\n<p>In the code below, the result brings back data of types: `hotel` and `city: Malibu`. Since the limit is five, only up to five rows are printed. The result that&#8217;s printed is `&#8221;Hotel: &#8220;` followed by information including the name and city.<\/p>\n<pre>    try {\r\n      var query = \r\n        \"SELECT h.name, h.city, h.state \" +\r\n        \"FROM `travel-sample` h \" +\r\n        \"WHERE h.type = $type \" +\r\n          \"AND h.city = $city LIMIT 5;\";\r\n\r\n      QueryResult result = cluster.query(query,\r\n        queryOptions().parameters(\r\n          JsonObject.create()\r\n            .put(\"type\", \"hotel\")\r\n            .put(\"city\", \"Malibu\")\r\n        ));\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>The result is taken from the `travel-sample` database, specifically from the rows. The `.stream` method is used to compute elements as per the primary method without changing the original value of the JSON object.<\/p>\n<pre>          result.rowsAsObject().stream().forEach(\r\n        e-&gt; System.out.println(\r\n          \"Hotel: \" + e.getString(\"name\") + \", \" + e.getString(\"city\"))\r\n      );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As before, the `catch` exception ensures there are no errors in your code. For example, if you chose a city or type of place that our database does not have, this `CouchbaseException` exception will print `&#8221;Exception: &#8220;` along with the string representation of the object that is causing the error.<\/p>\n<pre>    } catch (CouchbaseException ex) {\r\n      System.out.println(\"Exception: \" + ex.toString());\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\ub85c \ucffc\ub9ac\ud558\ub294 \ubc29\ubc95<\/h2>\n<p>\uc55e\uc11c \uc5b8\uae09\ud588\ub4ef\uc774 \ucffc\ub9ac \uba54\uc11c\ub4dc\uc5d0\ub294 \uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218 \ub610\ub294 \uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uba85\uba85\ub41c \ub9e4\uac1c\ubcc0\uc218\ub294 \uc704\uc5d0\uc11c \ub2e4\ub8e8\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774 \uc139\uc158\uc5d0\uc11c\ub294 \uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\uc640 \ubc29\ub300\ud55c \uc218\uc758 \ub9e4\uac1c\ubcc0\uc218\uac00 \uc788\ub294 \uba54\uc11c\ub4dc\ub97c \ud638\ucd9c\ud560 \ub54c \uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\uac00 \uc5b4\ub5bb\uac8c \uc720\uc6a9\ud55c\uc9c0 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc704\uce58 \ub9e4\uac1c\ubcc0\uc218\ub97c \uc0ac\uc6a9\ud558\uba74 \uba54\uc11c\ub4dc \ub9e4\uac1c\ubcc0\uc218\uc758 \uc21c\uc11c\ub97c \ud50c\ub808\uc774\uc2a4\ud640\ub354\ub85c \ub300\uccb4\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc608\ub97c \ub4e4\uc5b4 \uccab \ubc88\uc9f8 \uc790\ub9ac \ud45c\uc2dc\uc790\ub294 \uccab \ubc88\uc9f8 \uba54\uc11c\ub4dc \ub9e4\uac1c\ubcc0\uc218\ub85c \ub300\uccb4\ub418\uace0, \ub450 \ubc88\uc9f8 \uc790\ub9ac \ud45c\uc2dc\uc790\ub294 \ub450 \ubc88\uc9f8 \uba54\uc11c\ub4dc \ub9e4\uac1c\ubcc0\uc218\ub85c \ub300\uccb4\ub418\ub294 \uc2dd\uc785\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 7\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.CouchbaseException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\nimport com.couchbase.client.java.kv.*;\r\nimport com.couchbase.client.java.json.JsonArray;\r\ncom.couchbase.client.java.query.QueryResult\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\ncom.couchbase.client.java.query.QueryOptions\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.query.QueryOptions.queryOptions\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>The query below searches for the name, city and state from the `travel-sample` database taking into account specifically the type of place and the city. Later on, these are revealed as hotels in Malibu.<\/p>\n<pre>    try {\r\n      var query = \r\n        \"SELECT h.name, h.city, h.state \" +\r\n        \"FROM `travel-sample` h \" +\r\n        \"WHERE h.type = $1 \" +\r\n          \"AND h.city = $2 LIMIT 5;\";\r\n          \r\n      QueryResult result = cluster.query(query,\r\n        queryOptions().parameters(JsonArray.from(\"hotel\", \"Malibu\"))      );\r\n\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As with the named parameters example above, the `.stream` method is used to compute elements as per the primary method without changing the original value of the JSON object.<\/p>\n<pre>      result.rowsAsObject().stream().forEach(\r\n        e-&gt; System.out.println(\r\n          \"Hotel: \" + e.getString(\"name\") + \", \" + e.getString(\"city\"))\r\n      );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\ud558\uc704 \ubb38\uc11c \uc870\ud68c \uc791\uc5c5\uc744 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95<\/h2>\n<p><a href=\"https:\/\/docs.couchbase.com\/java-sdk\/2.7\/subdocument-operations.html?ref=blog\" target=\"_blank\" rel=\"noopener\">\ud558\uc704 \ubb38\uc11c<\/a> \ub294 \uc6d0\uc790 \ub2e8\uc704\ub85c \ud6a8\uc728\uc801\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8\ud558\uace0 \uac80\uc0c9\ud560 \uc218 \uc788\ub294 JSON \ubb38\uc11c\uc758 \uc77c\ubd80\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc804\uccb4 \ubb38\uc11c \uac80\uc0c9\uc740 \uc804\uccb4 \ubb38\uc11c\ub97c \uac80\uc0c9\ud558\uace0 \uc804\uccb4 \ubb38\uc11c \uc5c5\ub370\uc774\ud2b8\ub294 \uc804\uccb4 \ubb38\uc11c\ub97c \uc804\uc1a1\ud574\uc57c \ud558\ub294 \ubc18\uba74, \ud558\uc704 \ubb38\uc11c \uac80\uc0c9\uc740 \ubb38\uc11c\uc758 \uad00\ub828 \ubd80\ubd84\ub9cc \uac80\uc0c9\ud558\uace0 \ud558\uc704 \ubb38\uc11c \uc5c5\ub370\uc774\ud2b8\ub294 \ubb38\uc11c\uc758 \uc5c5\ub370\uc774\ud2b8\ub41c \ubd80\ubd84\ub9cc \uc804\uc1a1\ud558\uba74 \ub429\ub2c8\ub2e4. \ubb38\uc11c\uc758 \uc77c\ubd80\ub9cc \uc218\uc815\ud560 \ub54c\ub294 \ud558\uc704 \ubb38\uc11c \uc791\uc5c5\uc744, \ubb38\uc11c\uc758 \ub0b4\uc6a9\uc774 \ud06c\uac8c \ubcc0\uacbd\ub420 \ub54c\ub294 \uc804\uccb4 \ubb38\uc11c \uc791\uc5c5\uc744 \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc774 \ubb38\uc11c\uc5d0\uc11c \uc124\uba85\ud558\ub294 \ud558\uc704 \ubb38\uc11c \uc791\uc5c5\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. <strong>\ud0a4-\uac12 \uc694\uccad\ub9cc<\/strong>\ud558\uc704 \ubb38\uc11c SQL++ \ucffc\ub9ac\uc640\ub294 \uad00\ub828\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \ud558\uc704 \ubb38\uc11c \uc791\uc5c5\uc744 \uc0ac\uc6a9\ud558\ub824\uba74 \ud558\uc704 \ubb38\uc11c\uc758 \uc704\uce58\ub97c \ub098\ud0c0\ub0b4\ub294 \uacbd\ub85c\ub97c \uc9c0\uc815\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>The `lookupIn` operation queries the document for a certain path(s) and returns that path(s). You have a choice of actually retrieving the document path using the `<a href=\"https:\/\/www.couchbase.com\/blog\/ko\/subdoc-explained\/\">\ud558\uc704 \ubb38\uc11c<\/a> get` sub-document operation, or simply querying the existence of the path using the `subdoc exists` sub-document operation. The latter saves even more bandwidth by not retrieving the contents of the path if it is not needed.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 5\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.DocumentNotFoundException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\ncom.couchbase.client.java.kv.LookupInResult\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.kv.LookupInSpec.get\uc744 \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\njava.util.Collections\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n    var collection = bucket.defaultCollection();\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>In the code below, the `lookupIn`operation queries the `airport_1254` document for a certain path, the `geo.alt` path. This code allows us to retrieve the document path using the `subdoc get` sub-document operation: `(get(&#8220;geo.alt&#8221;))`.<\/p>\n<pre>try {\r\n      LookupInResult result = collection.lookupIn(\r\n        \"airport_1254\",\r\n        Collections.singletonList(get(\"geo.alt\"))\r\n      );\r\n\r\n      var str = result.contentAs(0, String.class);\r\n      System.out.println(\"Altitude = \" + str);\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As before, the `catch` exception ensures there are no errors in your code. For example, if you chose a city that our database does not have, this `DocumentNotFoundException` exception will print `&#8221;Document not found!&#8221;`.<\/p>\n<pre>     } catch (DocumentNotFoundException ex) {\r\n      System.out.println(\"Document not found!\");\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\ud558\uc704 \ubb38\uc11c \ubcc0\uacbd \uc791\uc5c5 \uc0ac\uc6a9 \ubc29\ubc95<\/h2>\n<p>\ud558\uc704 \ubb38\uc11c \ubcc0\uacbd \uc791\uc5c5\uc740 \ubb38\uc11c\uc5d0\uc11c \ud558\ub098 \uc774\uc0c1\uc758 \uacbd\ub85c\ub97c \uc218\uc815\ud569\ub2c8\ub2e4.<\/p>\n<p>The simplest of these operations is `subdoc upsert`. Just like the fulldoc-level upsert, the `subdoc upsert` operation either modifies the value of an existing path or creates it if it doesn&#8217;t exist. Likewise, the `subdoc insert` operation only adds the new value to the path if it doesn&#8217;t exist.<\/p>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 8\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.subdoc.PathNotFoundException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.core.error.subdoc.PathExistsException;\r\nimport com.couchbase.client.java.*;\r\ncom.couchbase.client.java.kv.LookupInResult\ub97c \uac00\uc838\uc635\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.kv.LookupInSpec.get\uc744 \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.kv.MutateInSpec.upsert\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\njava.util.Collections\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\njava.util.Arrays\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n    var collection = bucket.defaultCollection();\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>In the code below, the `mutateIn` operation is used to modify the `&#8221;airline_10&#8243;` by using a fulldoc-level upsert which will create the value of an existing path with parameters `(&#8220;country&#8221;, &#8220;Canada&#8221;)`.<\/p>\n<pre>    try {\r\n      LookupInResult result = collection.lookupIn(\r\n        \"airline_10\", Collections.singletonList(get(\"country\"))\r\n      );\r\n\r\n      var str = result.contentAs(0, String.class);\r\n      System.out.println(\"Sub-doc before: \");\r\n      System.out.println(str);\r\n      \r\n    } catch (PathNotFoundException e) {\r\n      System.out.println(\"Sub-doc path not found!\");\r\n    }\r\n\r\n    try {\r\n      collection.mutateIn(\"airline_10\", Arrays.asList(\r\n        upsert(\"country\", \"Canada\")\r\n      ));\r\n    } catch (PathExistsException e) {\r\n      System.out.println(\"Sub-doc path exists!\");\r\n    }\r\n\r\n    try {\r\n      LookupInResult result = collection.lookupIn(\r\n        \"airline_10\", Collections.singletonList(get(\"country\"))\r\n      );\r\n\r\n      var str = result.contentAs(0, String.class);\r\n      System.out.println(\"Sub-doc after: \");\r\n      System.out.println(str);\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As before, the `catch` exception ensures there are no errors in your code. For example, if you chose a document that your local computer does not have the pathway to, this `PathNotFoundException` exception will print `&#8221;Sub-doc path not found!&#8221;`.<\/p>\n<pre>    } catch (PathNotFoundException e) {\r\n      System.out.println(\"Sub-doc path not found!\");\r\n    }\r\n    \r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\uc5c5\uc11c\ud2b8 \uae30\ub2a5 \uc0ac\uc6a9 \ubc29\ubc95<\/h2>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/upsert.html?ref=blog\" target=\"_blank\" rel=\"noopener\">\uc5c5\uc11c\ud2b8 \uae30\ub2a5<\/a> is used to insert a new record or update an existing one. If the document doesn&#8217;t exist it will be created. Upsert is a combination of `insert` and `update`.<\/p>\n<p>Users executing the `upsert` statement must have the Query Update and Query Insert privileges on the target keyspace. If the statement has any returning clauses, then the Query Select privilege is also required on the keyspaces referred in the respective clauses. For more details about user roles, <a href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/security\/authorization-overview.html?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4\uc758 \uc5ed\ud560 \uae30\ubc18 \uc561\uc138\uc2a4 \uc81c\uc5b4(RBAC)\uc5d0 \ub300\ud55c \uad8c\ud55c \ubd80\uc5ec \uc124\uba85\uc11c\ub97c \ucc38\uc870\ud558\uc138\uc694.<\/a>.<\/p>\n<p>\ub2e4\uc74c\uc740 \ubaa8\ub4e0 \uc5c5\uc11c\ud2b8 \uc5f0\uc0b0\uc5d0 \ub300\ud55c \uae30\ubcf8 \uad6c\ubb38\uc744 \ubcf4\uc5ec\uc8fc\ub294 \ub2e4\uc774\uc5b4\uadf8\ub7a8\uc785\ub2c8\ub2e4:<\/p>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/upsert-basic-syntax-couchbase-database.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12227\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2021\/10\/upsert-basic-syntax-couchbase-database.png\" alt=\"The basic syntax of an upsert function for the Couchbase database\" width=\"675\" height=\"81\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/upsert-basic-syntax-couchbase-database.png 675w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/upsert-basic-syntax-couchbase-database-300x36.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/upsert-basic-syntax-couchbase-database-20x2.png 20w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/a><\/p>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\ub2e4\uc74c\uc740 \ud544\uc694\ud55c 9\uac00\uc9c0 \uac00\uc838\uc624\uae30 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre>com.couchbase.client.core.error.subdoc.PathNotFoundException\uc744 \uac00\uc838\uc635\ub2c8\ub2e4;\r\nimport com.couchbase.client.java.*;\r\nimport com.couchbase.client.java.kv.*;\r\nimport com.couchbase.client.java.kv.MutationResult;\r\nimport com.couchbase.client.java.json.JsonObject;\r\ncom.couchbase.client.java.kv.LookupInResult\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.kv.LookupInSpec.get\uc744 \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n\uc815\uc801 com.couchbase.client.java.kv.MutateInSpec.upsert\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\njava.util.Collections\ub97c \uc784\ud3ec\ud2b8\ud569\ub2c8\ub2e4;\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uadf8\ub7f0 \ub2e4\uc74c \uc774\uc804\uacfc \ube44\uc2b7\ud55c \ub2e8\uacc4\uc5d0 \ub530\ub77c \uac80\uc0c9\ud558\ub824\ub294 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ud569\ub2c8\ub2e4. \uc774 \ubaa8\ub4e0 \uc815\ubcf4\ub97c \ud504\ub85c\uadf8\ub7a8\uacfc \uad00\ub828\ub41c \uc815\ubcf4\ub85c \ubc14\uafb8\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre>class Program {\r\n    public static void main(String[] args) {\r\n    var cluster = Cluster.connect(\r\n      \"couchbase:\/\/127.0.0.1\", \"username\", \"password\"\r\n    );\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>\uc774\uc804\uacfc \ub9c8\ucc2c\uac00\uc9c0\ub85c Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0 \uc5f0\uacb0\ub418\uc5b4 \uc788\uc73c\uba70 \uc774\uc81c Couchbase \ubc84\ud0b7\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre>    var bucket = cluster.bucket(\"travel-sample\");\r\n    var collection = bucket.defaultCollection();\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>The `.put` method allows for the user to insert a mapping into a map. This means you can insert a specific key (and the value it is mapping to) into a particular map. If an existing key is passed then the previous value gets replaced by the new value.<\/p>\n<pre>    JsonObject content = JsonObject.create()\r\n      .put(\"country\", \"Iceland\")\r\n      .put(\"callsign\", \"ICEAIR\")\r\n      .put(\"iata\", \"FI\")\r\n      .put(\"icao\", \"ICE\")\r\n      .put(\"id\", 123)\r\n      .put(\"name\", \"Icelandair\")\r\n      .put(\"type\", \"airline\");\r\n\r\n    collection.upsert(\"airline_123\", content);\r\n      \r\n    try {\r\n      LookupInResult lookupResult = collection.lookupIn(\r\n        \"airline_123\", Collections.singletonList(get(\"name\"))\r\n      );\r\n\r\n      var str = lookupResult.contentAs(0, String.class);\r\n      System.out.println(\"New Document name = \" + str);\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>As before, the `catch` exception ensures there are no errors in your code. For example, if you chose a document that your local computer does not have the pathway to, this `PathNotFoundException` exception will print `&#8221;Document not found!&#8221;`.<\/p>\n<pre>    } catch (PathNotFoundException ex) {\r\n      System.out.println(\"Document not found!\");\r\n    }\r\n    \r\n  }\r\n}\r\n<\/pre>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<h2>\uacb0\ub860<\/h2>\n<p>\uc774 \uc785\ubb38 \ub2e8\uacc4\uc758 \uc548\ub0b4\ub97c \ud1b5\ud574 Couchbase \ubc0f Java SDK\ub85c \uc791\uc5c5\ud560 \ub54c \uac00\uc7a5 \uc77c\ubc18\uc801\uc778 \uae30\ub2a5 \uc911 \uc77c\ubd80\ub97c \uc774\ud574\ud558\uace0 \uc2e4\ud589\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub418\uc5c8\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \uc911\uae09 \ubc0f \uace0\uae09 \ub2e8\uacc4\ub85c \ub4e4\uc5b4\uac00\ub824\uba74 \ub2e4\uc74c\uacfc \uac19\uc774 \ud558\uc138\uc694, <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/hello-world\/start-using-sdk.html?ref=blog\" target=\"_blank\" rel=\"noopener\">\uc5ec\uae30\uc5d0\uc11c Java SDK \uc124\uba85\uc11c\ub97c \ud655\uc778\ud558\uc138\uc694.<\/a>.<\/p>\n<p>\ub3c4\uc6c0\uc774 \ud544\uc694\ud558\uac70\ub098 \uc601\uac10\uc774 \ud544\uc694\ud55c \uacbd\uc6b0, <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/forums\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ud3ec\ub7fc\uc744 \ud655\uc778\ud558\uc138\uc694.<\/a> \ucee4\ubba4\ub2c8\ud2f0\uc5d0\uc11c \uac19\uc740 \uc0dd\uac01\uc744 \uac00\uc9c4 \uac1c\ubc1c\uc790\ub4e4\uacfc \uc18c\ud1b5\ud558\uc138\uc694.<\/p>\n<p>\ub2e4\uc74c \ub2e8\uacc4\ub85c \ubb34\ub8cc\ub85c \uc81c\uacf5\ub418\ub294 \uc628\ub77c\uc778 <a href=\"https:\/\/learn.couchbase.com\/store\/1288710-cb130j-couchbase-associate-java-developer-certification-course-v7?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \uc900\ud68c\uc6d0 \uc790\ubc14 \uac1c\ubc1c\uc790 \uc790\uaca9\uc99d \uacfc\uc815<\/a> \uc81c\uacf5\ucc98 <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/academy\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \uc544\uce74\ub370\ubbf8<\/a>.<\/p>\n<div class=\"wp-block-spacer\" style=\"height: 30px\" aria-hidden=\"true\"><\/div>\n<div style=\"text-align: center\"><strong>\uc77d\uae30\ub9cc \ud558\uc9c0 \ub9c8\uc138\uc694, <em>\ube4c\ub4dc<\/em> something:<br \/><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/downloads\/?ref=blog\" target=\"_blank\" rel=\"noopener\">\uc9c0\uae08 Couchbase 7 \uc2dc\uc791\ud558\uae30<\/a><\/strong><\/div>\n<div class=\"wp-block-spacer\" style=\"height: 15px\" aria-hidden=\"true\"><\/div>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re a developer who&#8217;s new to Couchbase, this article helps you get started. This weekly walkthrough series helps you understand the basics of connecting to Couchbase, shows you how to retrieve and modify data in Couchbase Server, how to [&hellip;]<\/p>","protected":false},"author":79065,"featured_media":12224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,2381,2242,1816,1819,1818,9336,1813,1812,2201],"tags":[2312,1261,2313,1725,1903,1962,9317],"ppma_author":[9463],"class_list":["post-12222","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-community","category-connectors","category-couchbase-server","category-data-modeling","category-java","category-scopes-and-collections","category-security","category-n1ql-query","category-tools-sdks","tag-document-database","tag-json","tag-key-value","tag-nosql-database","tag-rbac","tag-role-based-access-control","tag-upsert"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase + Java Developer Walkthrough \u2013 Get Started!<\/title>\n<meta name=\"description\" content=\"In this developer walkthrough, we will look at the basic features of Couchbase \u2013 both through a non-relational JSON interface and relational SQL interface.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-java-developer-walkthrough\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Started with Couchbase + Java [Developer Walkthrough]\" \/>\n<meta property=\"og:description\" content=\"In this developer walkthrough, we will look at the basic features of Couchbase \u2013 both through a non-relational JSON interface and relational SQL interface.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-java-developer-walkthrough\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-07T07:00:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T01:43:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough-social.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"418\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nirupama Suravarjjala\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough-social.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nirupama Suravarjjala\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/\"},\"author\":{\"name\":\"Nirupama Suravarjjala\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bec70d9099ea0ff021938d01aeb5a033\"},\"headline\":\"Get Started with Couchbase + Java [Developer Walkthrough]\",\"datePublished\":\"2021-10-07T07:00:30+00:00\",\"dateModified\":\"2025-06-14T01:43:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/\"},\"wordCount\":2231,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg\",\"keywords\":[\"document database\",\"JSON\",\"key value\",\"NoSQL Database\",\"RBAC\",\"Role Based Access Control (RBAC)\",\"upsert\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Community\",\"Connectors\",\"Couchbase Server\",\"Data Modeling\",\"Java\",\"Scopes and Collections\",\"Security\",\"SQL++ \/ N1QL Query\",\"Tools &amp; SDKs\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/\",\"name\":\"Couchbase + Java Developer Walkthrough \u2013 Get Started!\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg\",\"datePublished\":\"2021-10-07T07:00:30+00:00\",\"dateModified\":\"2025-06-14T01:43:19+00:00\",\"description\":\"In this developer walkthrough, we will look at the basic features of Couchbase \u2013 both through a non-relational JSON interface and relational SQL interface.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg\",\"width\":1200,\"height\":628,\"caption\":\"Learn the basics of using Couchbase in this new developer tutorial using Java SDK code examples\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Started with Couchbase + Java [Developer Walkthrough]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bec70d9099ea0ff021938d01aeb5a033\",\"name\":\"Nirupama Suravarjjala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/e69bb35c1c3b5c0146633903aec65476\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg\",\"caption\":\"Nirupama Suravarjjala\"},\"url\":\"https:\/\/www.couchbase.com\/blog\/ko\/author\/nirupama-suravarjjala\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase + Java Developer Walkthrough \u2013 Get Started!","description":"\uc774 \uac1c\ubc1c\uc790 \uc6cc\ud06c\uc2a4\ub8e8\uc5d0\uc11c\ub294 \ube44\uad00\uacc4\ud615 JSON \uc778\ud130\ud398\uc774\uc2a4\uc640 \uad00\uacc4\ud615 SQL \uc778\ud130\ud398\uc774\uc2a4\ub97c \ud1b5\ud574 Couchbase\uc758 \uae30\ubcf8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-java-developer-walkthrough\/","og_locale":"ko_KR","og_type":"article","og_title":"Get Started with Couchbase + Java [Developer Walkthrough]","og_description":"In this developer walkthrough, we will look at the basic features of Couchbase \u2013 both through a non-relational JSON interface and relational SQL interface.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-java-developer-walkthrough\/","og_site_name":"The Couchbase Blog","article_published_time":"2021-10-07T07:00:30+00:00","article_modified_time":"2025-06-14T01:43:19+00:00","og_image":[{"width":800,"height":418,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough-social.jpg","type":"image\/jpeg"}],"author":"Nirupama Suravarjjala","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough-social.jpg","twitter_misc":{"Written by":"Nirupama Suravarjjala","Est. reading time":"11\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/"},"author":{"name":"Nirupama Suravarjjala","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bec70d9099ea0ff021938d01aeb5a033"},"headline":"Get Started with Couchbase + Java [Developer Walkthrough]","datePublished":"2021-10-07T07:00:30+00:00","dateModified":"2025-06-14T01:43:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/"},"wordCount":2231,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg","keywords":["document database","JSON","key value","NoSQL Database","RBAC","Role Based Access Control (RBAC)","upsert"],"articleSection":["Best Practices and Tutorials","Community","Connectors","Couchbase Server","Data Modeling","Java","Scopes and Collections","Security","SQL++ \/ N1QL Query","Tools &amp; SDKs"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/","name":"Couchbase + Java Developer Walkthrough \u2013 Get Started!","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg","datePublished":"2021-10-07T07:00:30+00:00","dateModified":"2025-06-14T01:43:19+00:00","description":"\uc774 \uac1c\ubc1c\uc790 \uc6cc\ud06c\uc2a4\ub8e8\uc5d0\uc11c\ub294 \ube44\uad00\uacc4\ud615 JSON \uc778\ud130\ud398\uc774\uc2a4\uc640 \uad00\uacc4\ud615 SQL \uc778\ud130\ud398\uc774\uc2a4\ub97c \ud1b5\ud574 Couchbase\uc758 \uae30\ubcf8 \uae30\ub2a5\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubd05\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/get-started-couchbase-java-sdk-developer-walkthrough.jpg","width":1200,"height":628,"caption":"Learn the basics of using Couchbase in this new developer tutorial using Java SDK code examples"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-java-developer-walkthrough\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Get Started with Couchbase + Java [Developer Walkthrough]"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bec70d9099ea0ff021938d01aeb5a033","name":"\ub2c8\ub8e8\ud30c\ub9c8 \uc218\ub77c\ubc14\ub974\uc798\ub77c","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/e69bb35c1c3b5c0146633903aec65476","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg","caption":"Nirupama Suravarjjala"},"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/nirupama-suravarjjala\/"}]}},"authors":[{"term_id":9463,"user_id":79065,"is_guest":0,"slug":"nirupama-suravarjjala","display_name":"Nirupama Suravarjjala","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2021\/10\/nirupama-suravarjjala-couchbase-intern.jpeg"},"author_category":"","last_name":"Suravarjjala","first_name":"Nirupama","job_title":"","user_url":"","description":"Nirupama Suravarjjala served as an intern on the Couchbase Developer Advocacy team."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/12222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/79065"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=12222"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/12222\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/12224"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=12222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=12222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=12222"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=12222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}