Posts

Showing posts with the label Build REST CRUD APIs

Spring Boot 3 Astra DB CRUD Example

Image
In this section,  we will learn how to build REST CRUD APIs with Spring Boot , and Astra DB . Astra DB DataStax Astra DB is a cloud-native, scalable Database-as-a-Service built on Apache Cassandra . Create a Database First, Sign into the datastax at https://astra.datastax.com . Then click on the "Databases" button. You will be taken to a page like the below image, then click on the " Create Database " button. Then enter Database name , Provider , and, Region , then click on the " Create Database " button. Now, You can see "Your database is initializing..." like the below image. You will be taken to a page like the below image. Copy " Database ID " and " region name " and keep them for future purposes. Generate Application Token Mocking Then click on " Tokens " button. You will be taken to a page like the below image, Then select role, for demo purpose here we selected role " Administrator User ". Then clic

Spring Boot JdbcClient CRUD Example

Image
In this section, we're gonna build CRUD REST APIs using Spring Boot application that use Spring  JdbcClient  to interact with PostgreSQL database. We are recommending you to cover  Spring JdbcClient Example   tutorial to get better understanding about JdbcClient .  What we will build? We will build CRUD RESTFul APIs for a Simple Student Management System using Spring Boot, JDBC API, and the PostgreSQL database. In this application we use JdbcClient to interact with PostgreSQL database. Creating a spring boot application First, open the Spring initializr  https://start.spring.io Then, Provide the Group and Artifact name. We have provided Group name com.knf.dev.demo and Artifact spring-boot-jdbcclient-crud. Here I selected the Maven project - language Java 17 - Spring Boot 3.2.0, Spring Web,JDBC API, and PostgreSQL Driver. Then, click on the Generate button. When we click on the Generate button, it starts packing the project in a .zip(spring-boot-jdbcclient-crud) file and downloads t