This article will guide you through a basic example of a Spring Boot 3 application which exposes CRUD Service method via a REST Endpoint. We will use PostgreSQL as datatabase, although you can easily switch to another RDBMs with some simple changes in the configuration.
Data Access
This section will teach you how to add database access to the Spring Boot applications using the following elements:
- A running database, whether initiated by/embedded within your application or
simply accessible to your application - Database drivers enabling programmatic access, usually provided by the database vendor
- A Spring Data module for accessing the target database.
Bulk Inserts with Spring Boot and JpaRepository
Bulk inserts are a common optimization technique for efficiently inserting multiple rows of data into a database. Spring Boot and its JDBC-based persistence layer, JpaRepository, provide support for performing bulk inserts.
Preloading Data in Spring Boot with import.sql and data.sql
When building Spring Boot applications, it’s common to require preloading data into the database. Two approaches to achieve this are using the import.sql
and data.sql
files. In this tutorial, we’ll explore these methods and highlight their differences.
How to use JPA Native Query in Spring Boot applications
Hibernate and JPA can both execute native SQL statements against a Database. In this tutorial we will learn how to map SQL native queries in Spring Boot applications.
Hikari Connection Pool with Spring Boot made simple
HikariCP is a fast, simple, production ready JDBC connection pool. In this article we will learn how to configure it in Spring Boot applications. Then, we will cover how to monitor Hikari Connection Pool properties using Spring Boot actuator.
SpringBoot JPA example with H2 DB
ne key feature of Spring is its support for the Java Persistence API (JPA), which is a Java specification for accessing, persisting, and managing data between Java objects/classes and a database. In this tutorial, we will learn how to use JPA with Spring Boot to build robust and efficient applications.
Spring Boot JPA example with PostgreSQL
In this tutorial we will learn how to create a basic JPA Spring Boot application that uses PostgreSQL as database. We will include a REST Controller and the Thymeleaf engine so that you can test your JPA Application in both ways.
How to find slow queries in Spring Boot
This article provides some guidance on how to spot Database queries which are taking most of your time during the execution of a Spring Boot application.
Data validation in Spring Boot 2.3.0 and beyond
This short article discusses how to compile projects data using javax.validation packages for Spring Boot 2.3.0 (and newer) applications.
Solving the error Failed to auto-configure a DataSource: ‘spring.datasource.url’ is not specified
This tutorial will help you to solve the error Failed to auto-configure a DataSource: ‘spring.datasource.url’ is not specified in your Spring Boot applications.