Discussion on: How to create simple rest apis with springboot

cadonau profile image
Markus Cadonau

Great timing. I was just experimenting with Spring Boot.
Any tips on connecting a database to store and retrieve model objects?

adityasridhar profile image
Aditya Sridhar Author

Hibernate is a good option.

You could also use spring JDBC. Explore both and check :)

youssefsab profile image
Youssef Sabry

If you need a fully fledged ORM, you can use Spring Data JPA with Hibernate which is really easy to get started quickly and works very well with Spring Boot. I use a library called JOOQ (Java Object Oriented Query) which allows you to write type safe SQL and provides you with code generation features. It also gives you basic CRUD. Also I use flyway for migrations.

arj profile image

Just have a look at the official guides.

There is one for relational database access (spring.io/guides/gs/relational-dat...) and for others as well.