{"id":10333,"date":"2025-09-06T10:02:26","date_gmt":"2025-09-06T17:02:26","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/quickstart-java-springboot\/"},"modified":"2025-09-06T10:02:26","modified_gmt":"2025-09-06T17:02:26","slug":"quickstart-java-springboot","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/","title":{"rendered":"Quickstart in Couchbase with Java and Spring Boot"},"content":{"rendered":"<h3 id=\"h-getting-started\" class=\"wp-block-heading\">Getting Started<\/h3>\n\n\n\n<h4 id=\"h-prerequisites\" class=\"wp-block-heading\">Voraussetzungen<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To run this prebuilt project, you will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.couchbase.com\/de\/products\/capella\/\">Couchbase Capella<\/a> cluster with <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/ref\/travel-app-data-model.html\">travel-sample<\/a> bucket loaded.\n<ul>\n<li>To run this tutorial using a self managed Couchbase cluster, please refer to the <a href=\"#running-self-managed-couchbase-cluster\">appendix<\/a>.<\/li>\n<\/ul>\n<\/li>\n\n\n<li>Java SDK 17 or higher installed<\/li>\n\n\n<li>Code Editor installed (IntelliJ IDEA, Eclipse, or Visual Studio Code)<\/li>\n\n\n<li>Maven command line<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-source-code\" class=\"wp-block-heading\">Source Code<\/h4>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>git clone https:\/\/github.com\/couchbase-examples\/java-springboot-quickstart.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-install-dependencies\" class=\"wp-block-heading\">Install Dependencies<\/h4>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>mvn clean compile\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Note: Maven automatically restores packages when building the project in IntelliJ IDEA or Eclipse depending on IDE configuration.<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-database-server-configuration\" class=\"wp-block-heading\">Database Server Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Die <code>CouchbaseConfig<\/code> class is a Spring configuration class responsible for setting up the connection to a Couchbase database in a Spring Boot application. It has been modernized with improved error handling and resilience:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><code>getCouchbaseCluster()<\/code>: Creates and configures a connection to the Couchbase cluster with:<\/p>\n<ul>\n<li>Proper variable scoping to handle connection timeouts gracefully<\/li>\n<li>30-second connection timeout with partial connectivity fallback<\/li>\n<li>Enhanced error logging and exception handling<\/li>\n<\/ul>\n<\/li>\n\n\n<li>\n<p><code>getCouchbaseBucket(Cluster cluster)<\/code>: Retrieves a Couchbase bucket from the cluster with:<\/p>\n<ul>\n<li>Bucket existence validation before connection attempts<\/li>\n<li>30-second ready timeout for improved reliability<\/li>\n<li>Comprehensive error handling for various failure scenarios<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Key Improvements<\/strong>: The configuration now handles connection timeouts more gracefully and provides better error diagnostics for troubleshooting connection issues.<\/p>\n\n\n\n<h4 id=\"h-application-properties\" class=\"wp-block-heading\">Application Properties<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You need to configure the connection details to your Couchbase Server in the <code>application.properties<\/code> file located in the <code>src\/main\/resources<\/code> directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The modern Spring Boot 3.5+ configuration uses updated property names:<\/p>\n\n\n\n<pre class=\"wp-block-code language-properties\"><code># Modern Couchbase configuration (Spring Boot 3.5+)\nspring.couchbase.connection-string=${DB_CONN_STR}\nspring.couchbase.username=${DB_USERNAME}\nspring.couchbase.password=${DB_PASSWORD}\nspring.couchbase.bucket.name=travel-sample\n\n# Connection optimizations\nspring.couchbase.env.timeouts.query=30000ms\nspring.couchbase.env.timeouts.key-value=5000ms\nspring.couchbase.env.timeouts.connect=10000ms\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-environment-variables-setup\" class=\"wp-block-heading\">Environment Variables Setup<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">For security, use a <code>.env<\/code> file in your project root with your actual credentials:<\/p>\n\n\n\n<pre class=\"wp-block-code language-properties\"><code>DB_CONN_STR=couchbases:\/\/xyz.cloud.couchbase.com\nDB_USERNAME=your_username\nDB_PASSWORD=your_password\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The connection string should be in the following format:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Couchbase Capella<\/strong>: <code>couchbases:\/\/xyz.cloud.couchbase.com<\/code> (secure)<\/li>\n\n\n<li><strong>Local Couchbase<\/strong>: <code>couchbase:\/\/localhost<\/code> (non-secure)<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The application uses the <code>dotenv-java<\/code> dependency to automatically load these environment variables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more information on the spring boot connection string, see <a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/application-properties.html\">Common Application Properties<\/a>.<\/p>\n\n\n\n<h3 id=\"h-running-the-application\" class=\"wp-block-heading\">Running The Application<\/h3>\n\n\n\n<h4 id=\"h-directly-on-the-machine\" class=\"wp-block-heading\">Directly on the machine<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">At this point the application is ready, and you can run it via your IDE or from the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>mvn spring-boot:run\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Note: Either the Couchbase Server must be installed and running on localhost or the connection string must be updated in the <code>application.properties<\/code> file.<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-docker\" class=\"wp-block-heading\">Docker<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Build the Docker image<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>docker build -t java-springboot-quickstart .\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the Docker image<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>docker run -d --name springboot-container -p 8080:8080   \n  -e DB_CONN_STR=&lt;connection_string&gt;   \n  -e DB_USERNAME=&lt;username&gt;   \n  -e DB_PASSWORD=&lt;password&gt;   \n  java-springboot-quickstart\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: The <code>application.properties<\/code> file has the connection information to connect to your Capella cluster. You can also pass the connection information as environment variables to the Docker container.\nIf you choose not to pass the environment variables, you can update the <code>application.properties<\/code> file in the <code>src\/main\/resources<\/code> folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the application is running, you can see the logs in the console. You should see the following log message indicating that the application has started successfully:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/app-startup-spring-boot.png\" alt=\"Spring Boot Application\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the site is up and running you can launch your browser and go to the <a href=\"http:\/\/localhost:8080\/swagger-ui\/index.html\">Swagger Start Page<\/a> to test the APIs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/swagger-documentation-spring-boot.png\" alt=\"Swagger UI\"><\/p>\n\n\n\n<h3 id=\"h-data-model\" class=\"wp-block-heading\">Data Model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For this tutorial, we use three collections, <code>airport<\/code>, <code>airline<\/code> und <code>route<\/code> that contain sample airports, airlines and airline routes respectively. The route collection connects the airports and airlines as seen in the figure below. We use these connections in the quickstart to generate airports that are directly connected and airlines connecting to a destination airport. Note that these are just examples to highlight how you can use SQL++ queries to join the collections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/travel_sample_data_model.png\" alt=\"Data Model\"><\/p>\n\n\n\n<h3 id=\"h-airline-document-structure\" class=\"wp-block-heading\">Airline Document Structure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will be setting up a REST API to manage some airline documents. The <code>name<\/code> field is the name of the airline. The <code>callsign<\/code> field is the callsign of the airline. The <code>iata<\/code> field is the IATA code of the airline. The <code>icao<\/code> field is the ICAO code of the airline. The <code>country<\/code> field is the country of the airline.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our airline document will have a structure similar to the following example:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n  &quot;name&quot;: &quot;Couchbase Airways&quot;,\n  &quot;callsign&quot;: &quot;Couchbase&quot;,\n  &quot;iata&quot;: &quot;CB&quot;,\n  &quot;icao&quot;: &quot;CBA&quot;,\n  &quot;country&quot;: &quot;United States&quot;\n}\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-let-s-review-the-code\" class=\"wp-block-heading\">Let&#8217;s Review the Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To begin open the repository in an IDE of your choice to learn about how to create, read, update and delete documents in your Couchbase Server.<\/p>\n\n\n\n<h4 id=\"h-code-organization\" class=\"wp-block-heading\">Code Organization<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>src\/test\/java<\/code>: Contains integration tests.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springboot\/repositories<\/code>: Contains the repository implementation.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springboot\/models<\/code>: Contains the data model.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springboot\/controllers<\/code>: Contains the RESTful API controllers.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springboot\/services<\/code>: Contains the service classes.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-model\" class=\"wp-block-heading\">Model<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Airline.java<\/code>\nThis class represents the data model for an airline. It contains fields such as ID, type, name, IATA code, ICAO code, callsign, and country. The class uses annotations for validation.<\/p>\n\n\n\n<h4 id=\"h-controller\" class=\"wp-block-heading\">Controller<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineController.java<\/code>\nThis class defines the RESTful API endpoints for managing airlines. It handles HTTP requests for creating, updating, deleting, and retrieving airlines. It also provides endpoints for listing airlines by various criteria.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example of the pattern for the <code>GET<\/code> mapping is shown below.For the full code, see the <a href=\"https:\/\/github.com\/couchbase-examples\/java-springboot-quickstart\/blob\/main\/src\/main\/java\/org\/couchbase\/quickstart\/springboot\/controllers\/AirlineController.java\">AirlineController.java<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>@RestController\n@RequestMapping(&quot;\/api\/v1\/airline&quot;)\n@Slf4j\npublic class AirlineController {\n\n   private final AirlineService airlineService;\n\n    public AirlineController(AirlineService airlineService) {\n        this.airlineService = airlineService;\n    }\n\n    \/\/ Error messages\n    private static final String INTERNAL_SERVER_ERROR = &quot;Internal Server Error&quot;;\n    private static final String DOCUMENT_NOT_FOUND = &quot;Document Not Found&quot;;\n\n    @GetMapping(&quot;\/{id}&quot;)\n    @Operation(summary = &quot;Get an airline by ID&quot;)\n    @Description(value = &quot;...&quot;)\n    public ResponseEntity&lt;Airline&gt; getAirline(@PathVariable String id) {\n        try {\n            Airline airline = airlineService.getAirlineById(id);\n            if (airline != null) {\n                return new ResponseEntity&lt;&gt;(airline, HttpStatus.OK);\n            } else {\n                log.error(DOCUMENT_NOT_FOUND + &quot;: &quot; + id);\n                return new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND);\n            }\n        } catch (DocumentNotFoundException e) {\n            log.error(DOCUMENT_NOT_FOUND + &quot;: &quot; + id);\n            return new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND);\n        } catch (Exception e) {\n            log.error(INTERNAL_SERVER_ERROR + &quot;: &quot; + e.getMessage());\n            return new ResponseEntity&lt;&gt;(HttpStatus.INTERNAL_SERVER_ERROR);\n        }\n    }\n}\n\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-service\" class=\"wp-block-heading\">Dienst<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineServiceImpl.java<\/code>\nThis class implements the AirlineService interface. It acts as an intermediary between the controller and repository, providing business logic for managing airlines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example of the pattern for AirlineService is shown below. For the full code, see the <a href=\"https:\/\/github.com\/couchbase-examples\/java-springboot-quickstart\/blob\/main\/src\/main\/java\/org\/couchbase\/quickstart\/springboot\/services\/AirlineServiceImpl.java\">AirlineServiceImpl.java<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>public interface AirlineService {\n\n    Airline getAirlineById(String id);\n\n    ...\n}\n\n@Service\npublic class AirlineServiceImpl implements AirlineService {\n\n    private final AirlineRepository airlineRepository;\n\n    public AirlineServiceImpl(AirlineRepository airlineRepository) {\n        this.airlineRepository = airlineRepository;\n    }\n\n    @Override\n    public Airline getAirlineById(String id) {\n        return airlineRepository.findById(id);\n    }\n\n    ...\n}\n\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-repository\" class=\"wp-block-heading\">Repository<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineRepositoryImpl.java<\/code>\nThis class implements the AirlineRepository interface. It interacts with the Couchbase database to perform CRUD operations on airline documents. It uses the Couchbase Java SDK to execute queries and operations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example of the pattern for AirlineRepository is shown below. For the full code, see the <a href=\"https:\/\/github.com\/couchbase-examples\/java-springboot-quickstart\/blob\/main\/src\/main\/java\/org\/couchbase\/quickstart\/springboot\/repositories\/AirlineRepositoryImpl.java\">AirlineRepositoryImpl.java<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>public interface AirlineRepository {\n\n    Airline findById(String id);\n\n    ...\n}\n\n@Repository\npublic class AirlineRepositoryImpl implements AirlineRepository {\n\n    private final Cluster cluster;\n    private final Collection airlineCol;\n    private final CouchbaseConfig couchbaseConfig;\n\n    public AirlineRepositoryImpl(Cluster cluster, Bucket bucket, CouchbaseConfig couchbaseConfig) {\n        this.cluster = cluster;\n        this.airlineCol = bucket.scope(&quot;inventory&quot;).collection(&quot;airline&quot;);\n        this.couchbaseConfig = couchbaseConfig;\n    }\n\n    @Override\n    public Airline findById(String id) {\n        return airlineCol.get(id).contentAs(Airline.class);\n    }\n\n    ...\n}\n\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-mapping-workflow\" class=\"wp-block-heading\">Mapping Workflow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Mapping workflows describe how the HTTP methods (GET, POST, PUT, DELETE) interact with the <code>AirlineService<\/code> and the underlying database through the <code>AirlineRepository<\/code> to perform various operations on airline data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simple REST API using Spring Boot and the <code>Couchbase SDK version 3.x<\/code> with the following endpoints:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#get-mapping-workflow\">Retrieve airlines by ID<\/a>.<\/li>\n\n\n<li><a href=\"#post-mapping-workflow\">Create new airlines with essential information<\/a>.<\/li>\n\n\n<li><a href=\"#put-mapping-workflow\">Update airline details<\/a>.<\/li>\n\n\n<li><a href=\"#delete-mapping-workflow\">Delete airlines<\/a>.<\/li>\n\n\n<li><a href=\"#get-mapping-workflow\">List all airlines with pagination<\/a>.<\/li>\n\n\n<li><a href=\"#custom-sql-queries\">List airlines by country and destination airport<\/a>.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-get-mapping-workflow\" class=\"wp-block-heading\">GET Mapping Workflow<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>@GetMapping(\"\/{id}\")<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The GET mapping is triggered when a client sends an HTTP GET request to <code>\/api\/v1\/airline\/{id}<\/code> Wo? <code>{id}<\/code> is the unique identifier of the airline.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Die <code>AirlineController<\/code> receives the request and extracts the <code>id<\/code> from the URL path.<\/li>\n\n\n<li>It then calls the <code>getAirlineById<\/code> method of the <code>AirlineService<\/code>, passing the extracted <code>id<\/code> as a parameter.This function internally calls <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/kv-operations.html#retrieving-documents\">get()<\/a> to retrieve the airline from the database.<\/li>\n\n\n<li>Die <code>AirlineService<\/code> interacts with the database through the <code>AirlineRepository<\/code> to find the airline with the specified <code>id<\/code>.<\/li>\n\n\n<li>If the airline is found, the <code>AirlineService<\/code> returns it as a response.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> constructs an HTTP response with a status code of 200 OK and includes the airline data in the response body as a JSON object.<\/li>\n\n\n<li>The response is sent back to the client with the airline data if found, or a 404 Not Found response if the airline does not exist.<\/li>\n\n<\/ol>\n\n\n\n<h4 id=\"h-post-mapping-workflow\" class=\"wp-block-heading\">POST Mapping Workflow<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>@PostMapping(\"\/{id}\")<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The POST mapping is triggered when a client sends an HTTP POST request to <code>\/api\/v1\/airline\/{id}<\/code>, where <code>{id}<\/code> is typically a unique identifier generated by the server (not provided by the client).<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The client includes the data of the new airline to be created in the request body as a JSON object.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> receives the request and extracts the <code>id<\/code> from the URL path, but this <code>id<\/code> is not used for creating the airline; it&#8217;s often generated by the server.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> calls the <code>createAirline<\/code> method of the <code>AirlineService<\/code>, passing the airline data from the request body. This function internally calls <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/kv-operations.html#insert\">airlineCol.insert()<\/a> to insert the airline into the database.<\/li>\n\n\n<li>Die <code>AirlineService<\/code> is responsible for creating a new airline and saving it to the database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is created successfully, the <code>AirlineService<\/code> returns the newly created airline.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> constructs an HTTP response with a status code of 201 Created and includes the created airline data in the response body as a JSON object.<\/li>\n\n\n<li>The response is sent back to the client with the newly created airline data.<\/li>\n\n<\/ol>\n\n\n\n<h4 id=\"h-put-mapping-workflow\" class=\"wp-block-heading\">PUT Mapping Workflow<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>@PutMapping(\"\/{id}\")<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The PUT mapping is triggered when a client sends an HTTP PUT request to <code>\/api\/v1\/airline\/{id}<\/code>, where <code>{id}<\/code> is the unique identifier of the airline to be updated.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The client includes the updated data of the airline in the request body as a JSON object.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> receives the request, extracts the <code>id<\/code> from the URL path, and retrieves the updated airline data from the request body.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> calls the <code>updateAirline<\/code> method of the <code>AirlineService<\/code>, passing the <code>id<\/code> and updated airline data. This function internally calls <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/kv-operations.html#replace\">airlineCol.replace()<\/a> to replace the airline in the database.<\/li>\n\n\n<li>Die <code>AirlineService<\/code> is responsible for updating the airline in the database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is updated successfully, the <code>AirlineService<\/code> returns the updated airline.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> constructs an HTTP response with a status code of 200 OK and includes the updated airline data in the response body as a JSON object.<\/li>\n\n\n<li>The response is sent back to the client with the updated airline data if found, or a 404 Not Found response if the airline with the specified ID does not exist.<\/li>\n\n<\/ol>\n\n\n\n<h4 id=\"h-delete-mapping-workflow\" class=\"wp-block-heading\">DELETE Mapping Workflow<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>@DeleteMapping(\"\/{id}\")<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The DELETE mapping is triggered when a client sends an HTTP DELETE request to <code>\/api\/v1\/airline\/{id}<\/code>, where <code>{id}<\/code> is the unique identifier of the airline to be deleted.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Die <code>AirlineController<\/code> receives the request and extracts the <code>id<\/code> from the URL path.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> calls the <code>deleteAirline<\/code> method of the <code>AirlineService<\/code>, passing the <code>id<\/code> of the airline to be deleted. This function internally calls <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/kv-operations.html#removing\">airlineCol.remove()<\/a> to remove the airline from the database.<\/li>\n\n\n<li>Die <code>AirlineService<\/code> is responsible for deleting the airline from the database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is deleted successfully, the <code>AirlineService<\/code> performs the deletion operation without returning any response data.<\/li>\n\n\n<li>Die <code>AirlineController<\/code> constructs an HTTP response with a status code of 204 No Content, indicating that the request was successful, but there is no content to return in the response body.<\/li>\n\n\n<li>The response is sent back to the client to indicate the successful deletion of the airline.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">These workflows illustrate how each HTTP method interacts with the <code>AirlineService<\/code> and the underlying database through the <code>AirlineRepository<\/code> to perform various operations on airline data.<\/p>\n\n\n\n<h3 id=\"h-custom-sql-queries\" class=\"wp-block-heading\">Custom SQL++ Queries<\/h3>\n\n\n\n<h4 id=\"h-1--get-all-airlines-by-country\" class=\"wp-block-heading\">1. Get all airlines by country<\/h4>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>\n @Override\n    public List&lt;Airline&gt; findByCountry(String country, int limit, int offset) {\n        String statement = &quot;SELECT airline.id, airline.type, airline.name, airline.iata, airline.icao, airline.callsign, airline.country FROM `&quot;\n                + couchbaseConfig.getBucketName() + &quot;`.`inventory`.`airline` WHERE country = $1 LIMIT $2 OFFSET $3&quot;;\n        return cluster\n                .query(statement,\n                        QueryOptions.queryOptions().parameters(JsonArray.from(country, limit, offset))\n                                .scanConsistency(QueryScanConsistency.REQUEST_PLUS))\n                .rowsAs(Airline.class);\n  }\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the above example, we are using the <code>QueryOptions<\/code> class to set the <code>scanConsistency<\/code> to <code>REQUEST_PLUS<\/code> to ensure that the query returns the latest data. We are also using the <code>JsonObject<\/code> class to set the <code>country<\/code> parameter in the query. For more information on query options and scan consistency, you can refer to the <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/n1ql-queries-with-sdk.html#scan-consistency\">Query Options and Scan Consistency<\/a> Dokumentation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we are using the <code>rowsAs<\/code> method to return the query results as a list of <code>Fluggesellschaft<\/code> objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the query, we are using the <code>country<\/code> parameter to filter the results by country. We are also using the <code>limit<\/code> und <code>offset<\/code> parameters to limit the number of results returned and to implement pagination.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the query is executed, the <code>AirlineController<\/code> constructs an HTTP response with a status code of 200 OK and includes the list of airlines in the response body as a list of JSON objects.<\/p>\n\n\n\n<h4 id=\"h-2--get-all-airlines-by-destination-airport\" class=\"wp-block-heading\">2. Get all airlines by destination airport<\/h4>\n\n\n\n<pre class=\"wp-block-code language-java\"><code> @Override\n    public List&lt;Airline&gt; findByDestinationAirport(String destinationAirport, int limit, int offset) {\n        String statement = &quot;SELECT air.callsign, air.country, air.iata, air.icao, air.id, air.name, air.type &quot; +\n                &quot;FROM (SELECT DISTINCT META(airline).id AS airlineId &quot; +\n                &quot;      FROM `&quot; + couchbaseConfig.getBucketName() + &quot;`.`inventory`.`route` &quot; +\n                &quot;      JOIN `&quot; + couchbaseConfig.getBucketName() + &quot;`.`inventory`.`airline` &quot; +\n                &quot;      ON route.airlineid = META(airline).id &quot; +\n                &quot;      WHERE route.destinationairport = $1) AS subquery &quot; +\n                &quot;JOIN `&quot; + couchbaseConfig.getBucketName() + &quot;`.`inventory`.`airline` AS air &quot; +\n                &quot;ON META(air).id = subquery.airlineId LIMIT $2 OFFSET $3&quot;;\n\n        return ...\n  }\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the query, we are using the <code>destinationAirport<\/code> parameter to filter the results by destination airport. We are also using the <code>limit<\/code> und <code>offset<\/code> parameters to limit the number of results returned and to implement pagination.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We are performing a <code>JOIN<\/code> operation between the <code>route<\/code> und <code>airline<\/code> documents to get the airlines that fly to the specified destination airport. We are using the <code>META<\/code> function to get the ID of the airline document.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the query is executed, the <code>AirlineController<\/code> constructs an HTTP response with a status code of 200 OK and includes the list of airlines in the response body as a list of JSON objects.<\/p>\n\n\n\n<h3 id=\"h-running-the-tests\" class=\"wp-block-heading\">Running The Tests<\/h3>\n\n\n\n<h4 id=\"h-integration-tests\" class=\"wp-block-heading\">Integration Tests<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This project uses Maven with proper integration test configuration. The tests connect to a real Couchbase instance and validate actual functionality:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>mvn test\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important<\/strong>: This project was modernized to ensure integration tests actually execute (no false positives). The Maven surefire plugin configuration was updated to include integration tests that were previously excluded.<\/p>\n\n\n\n<h4 id=\"h-test-validation\" class=\"wp-block-heading\">Test Validation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To verify tests are actually running:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Tests should show connection logs to Couchbase<\/li>\n\n\n<li>Test count should show actual execution (e.g., &#8220;Tests run: 18&#8221;)<\/li>\n\n\n<li>Any test failures will show real assertion errors<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-continuous-integration\" class=\"wp-block-heading\">Continuous Integration<\/h3>\n\n\n\n<h4 id=\"h-github-actions\" class=\"wp-block-heading\">GitHub Actions<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The project includes a modern GitHub Actions workflow (<code>.github\/workflows\/tests.yaml<\/code>) with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Multiple Java Versions<\/strong>: Tests on Java 17 and 21<\/li>\n\n\n<li><strong>Manual Triggering<\/strong>: <code>workflow_dispatch<\/code> allows manual test runs<\/li>\n\n\n<li><strong>Reliability Improvements<\/strong>: 15-minute timeouts, fail-fast disabled for complete results<\/li>\n\n\n<li><strong>Test Artifacts<\/strong>: Automatic upload of test reports for debugging<\/li>\n\n\n<li><strong>Simplified Commands<\/strong>: Uses <code>.\/mvnw clean test<\/code> for focused testing<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-running-in-cicd\" class=\"wp-block-heading\">Running in CI\/CD<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The workflow automatically:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Sets up Java with Temurin distribution<\/li>\n\n\n<li>Caches Maven dependencies for faster builds<\/li>\n\n\n<li>Executes integration tests against Couchbase<\/li>\n\n\n<li>Uploads test results as artifacts<\/li>\n\n\n<li>Sends failure notifications to Slack (if configured)<\/li>\n\n<\/ol>\n\n\n\n<h4 id=\"h-run-individual-tests\" class=\"wp-block-heading\">Run Individual Tests:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, you can run individual test classes or methods using the following commands:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To run the tests for the AirlineIntegrationTest class:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>mvn test -Dtest=org.couchbase.quickstart.springboot.controllers.AirlineIntegrationTest\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To run the tests for the AirportIntegrationTest class:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>mvn test -Dtest=org.couchbase.quickstart.springboot.controllers.AirportIntegrationTest\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To run the tests for the RouteIntegrationTest class:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>mvn test -Dtest=org.couchbase.quickstart.springboot.controllers.RouteIntegrationTest\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-project-setup-notes\" class=\"wp-block-heading\">Project Setup Notes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This project was based on the standard <a href=\"https:\/\/spring.io\/guides\/gs\/rest-service\/\">Spring Boot project<\/a> with the following specifications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Spring Boot Version<\/strong>: 3.5.5 (modernized from earlier versions)<\/li>\n\n\n<li><strong>Java Version<\/strong>: 17+ (updated from Java 8)<\/li>\n\n\n<li><strong>Build Tool<\/strong>: Maven with wrapper (<code>mvnw<\/code>)<\/li>\n\n\n<li><strong>Key Dependencies<\/strong>:\n<ul>\n<li>Spring Boot Starter Web<\/li>\n<li>Couchbase Java SDK 3.7.9<\/li>\n<li>Spring Boot Validation<\/li>\n<li>SpringDoc OpenAPI (Swagger)<\/li>\n<li>Dotenv Java for environment variable management<\/li>\n<li>Project Lombok for reduced boilerplate<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A full list of packages and versions are referenced in the <code>pom.xml<\/code> file.<\/p>\n\n\n\n<h3 id=\"h-contributing\" class=\"wp-block-heading\">Contributing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Contributions are welcome! If you&#8217;d like to contribute to this project, please fork the repository and create a pull request.<\/p>\n\n\n\n<h3 id=\"h-appendix\" class=\"wp-block-heading\">Appendix<\/h3>\n\n\n\n<h4 id=\"h-extending-api-by-adding-new-entity\" class=\"wp-block-heading\">Extending API by Adding New Entity<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you would like to add another entity to the APIs, these are the steps to follow:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the new entity (collection) in the Couchbase bucket. You can create the collection using the <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/provisioning-cluster-resources.html#collection-management\">SDK<\/a> or via the <a href=\"https:\/\/docs.couchbase.com\/cloud\/n1ql\/n1ql-language-reference\/createcollection.html\">Couchbase Server interface<\/a>.<\/li>\n\n\n<li>Define the routes in a new class in the <code>controllers<\/code> package similar to the existing routes like <code>AirportController.java<\/code>.<\/li>\n\n\n<li>Define the service in a new class in the <code>services<\/code> package similar to the existing services like <code>AirportService.java<\/code>.<\/li>\n\n\n<li>Define the repository in a new class in the <code>repositories<\/code> package similar to the existing repositories like <code>AirportRepository.java<\/code>.<\/li>\n\n\n<li>For integration tests, create a new class in the <code>controllers<\/code> package similar to the existing tests like <code>AirportIntegrationTest.java<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-running-self-managed-couchbase-cluster\" class=\"wp-block-heading\">Running Self Managed Couchbase Cluster<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running this quickstart with a self managed Couchbase cluster, you need to <a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-settings\/install-sample-buckets.html\">load<\/a> the travel-sample data bucket in your cluster and generate the credentials for the bucket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to update the connection string and the credentials in the <a href=\"https:\/\/github.com\/couchbase-examples\/java-springboot-quickstart\/blob\/main\/src\/main\/resources\/application.properties\"><code>src\/main\/resources\/application.properties<\/code><\/a> file.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>HINWEIS:<\/strong> Couchbase must be installed and running prior to running the Spring Boot app.<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-swagger-documentation\" class=\"wp-block-heading\">Swagger Documentation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documentation provides a clear view of the API including endpoints, HTTP methods, request parameters, and response objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on an individual endpoint to expand it and see detailed information. This includes the endpoint&#8217;s description, possible response status codes, and the request parameters it accepts.<\/p>\n\n\n\n<h5 id=\"h-trying-out-the-api\" class=\"wp-block-heading\">Trying Out the API<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">You can try out an API by clicking on the &#8220;Try it out&#8221; button next to the endpoints.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Parameters: If an endpoint requires parameters, Swagger UI provides input boxes for you to fill in. This could include path parameters, query strings, headers, or the body of a POST\/PUT request.<\/p>\n<\/li>\n\n\n<li>\n<p>Execution: Once you&#8217;ve inputted all the necessary parameters, you can click the &#8220;Execute&#8221; button to make a live API call. Swagger UI will send the request to the API and display the response directly in the documentation. This includes the response code, response headers, and response body.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h5 id=\"h-models\" class=\"wp-block-heading\">Models<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documents the structure of request and response bodies using models. These models define the expected data structure using JSON schema and are extremely helpful in understanding what data to send and expect.<\/p>","protected":false},"excerpt":{"rendered":"<p>Getting Started Prerequisites To run this prebuilt project, you will need: Source Code Install Dependencies Note: Maven automatically restores packages when building the project in IntelliJ IDEA or Eclipse depending on IDE configuration. Database Server Configuration The CouchbaseConfig class is a Spring configuration class responsible for setting up the connection to a Couchbase database in [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[636],"tutorial-tags":[546,637],"tutorial-technologies":[548,549],"tutorial-types":[550],"class_list":["post-10333","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-java","tutorial-tags-rest-api","tutorial-tags-spring-boot","tutorial-technologies-kv","tutorial-technologies-query","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickstart in Couchbase with Java and Spring Boot - Couchbase<\/title>\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\/de\/developers\/tutorials\/quickstart-java-springboot\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart in Couchbase with Java and Spring Boot\" \/>\n<meta property=\"og:description\" content=\"Getting Started Prerequisites To run this prebuilt project, you will need: Source Code Install Dependencies Note: Maven automatically restores packages when building the project in IntelliJ IDEA or Eclipse depending on IDE configuration. Database Server Configuration The CouchbaseConfig class is a Spring configuration class responsible for setting up the connection to a Couchbase database in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"16\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/quickstart-java-springboot\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/quickstart-java-springboot\\\/\",\"name\":\"Quickstart in Couchbase with Java and Spring Boot - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\"},\"datePublished\":\"2025-09-06T17:02:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/quickstart-java-springboot\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/quickstart-java-springboot\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/developers\\\/tutorials\\\/quickstart-java-springboot\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart in Couchbase with Java and Spring Boot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart in Couchbase with Java and Spring Boot - Couchbase","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\/de\/developers\/tutorials\/quickstart-java-springboot\/","og_locale":"de_DE","og_type":"article","og_title":"Quickstart in Couchbase with Java and Spring Boot","og_description":"Getting Started Prerequisites To run this prebuilt project, you will need: Source Code Install Dependencies Note: Maven automatically restores packages when building the project in IntelliJ IDEA or Eclipse depending on IDE configuration. Database Server Configuration The CouchbaseConfig class is a Spring configuration class responsible for setting up the connection to a Couchbase database in [&hellip;]","og_url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"16\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/","url":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/","name":"Quickstart in Couchbase with Java and Spring Boot - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/de\/#website"},"datePublished":"2025-09-06T17:02:26+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/de\/developers\/tutorials\/quickstart-java-springboot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Quickstart in Couchbase with Java and Spring Boot"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/de\/#website","url":"https:\/\/www.couchbase.com\/de\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/de\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/de\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase ist ein in San Jose, Kalifornien, ans\u00e4ssiges Unternehmen f\u00fcr Datenbanksoftware, das eine operative Datenplattform f\u00fcr KI bereitstellt, die von Hunderten von globalen Unternehmen eingesetzt wird.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorials\/10333\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/media?parent=10333"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-languages?post=10333"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-tags?post=10333"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-technologies?post=10333"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/de\/wp-json\/wp\/v2\/tutorial-types?post=10333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}