Posts

Showing posts with the label crud

Spring JdbcClient Example

Image
In this section, we're gonna build a Spring Boot application that use Spring  JdbcClient to interact with PostgreSQL database. Spring Framework 6.1 introduced the JdbcClient API. As we all know, Spring Framework 6.1 is part of Spring Boot version 3.2.  We can use the Spring JdbcClient interface to define the query, set the parameters, and perform the DB operation, using a fluent API.  Fluent APIs are designed to make the code more readable and therefore easier to use. Wiring objects together using method chaining helps accomplish these readability and usability goals. An example for retrieving a Student as a Optional: public Optional < Student > findStudentById ( Long id) { String sql = "select id, name, age, gender, " + "email from students where id = :id" ; return jdbcClient .sql( sql ) .param( "id" , id) .query( Student . class ) .optional(); } What we will build? We will build a s

Spring Boot 3 + Angular 15 + Material - Full Stack CRUD Application Example

Image
In this section we will develop a full-stack application that is a basic Student management application using Spring Boot 3, Angular 15, Material and PostgreSQL. You could download the source code from our GitHub repository, the download link is provided at the end of this article. After completing this tutorial what we will build?   We will build a full-stack web application that is a basic Student Management Application with CRUD features:  Create Student List Student Update Student  Delete Student Technologies used: Spring Boot 3+ Spring Data JPA PostgreSQL Java 17 Angular 15 Angular Material UI 1. Backend Development Creating a Spring boot web 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-boot3-postgresql-crud-app . Here I selected the Maven project - language Java 17 ,  Spring Boot 3.1.4  (latest) and add Spring web dependency , PostgreSQL Driver