Spring Boot 3 Crash Course Part 3: Hibernate and Persist
15 min readNov 11, 2023
Before delving into the creation of robust APIs, Let’s take a quick diversion to learn about how we can access a database in Spring and save and retrieve our data efficiently.
Part 2 — Link
Part 4 is now available: Here
Pre-Requisites:
- Knowledge of what is a Database and DBMS.
- A little bit of SQL basics.
Table Of Contents:
- Using a database in spring
- The easier way to use databases
- What is hibernate?
- Setting up a free database
- Setting up the Spring Boot project
- Connecting to a database
- Repositories, Entity Managers and Contexts
- CRUD operations using hibernate
Using A Database In Spring:
Spring provides a JDBC dependency for database access. Spring JDBC simplifies database interaction in Java applications by handling many of the tedious and error-prone tasks associated with database access.
JDBC stands for Java Database Connectivity. It is a Java-based API (Application Programming Interface) that allows Java…