CHAPTER 5

Data Access with

Spring Boot

Data has become the most important part of the IT world, from trying to access, persist,

and analyze it, to using a few bytes to petabytes of information. There have been many

attempts to create frameworks and libraries to facilitate a way for developers to interact

with the data, but sometimes this becomes too complicated.

After version 3.0, the Spring Framework created different teams that specialized

in the different technologies. The Spring Data project team was born. This particular

project’s goal is to simplify uses of data access technologies, from relational and non-

relational databases, to map-reduce frameworks and cloud-based data services. This

Spring Data project is a collection of subprojects specific to a given database.

This chapter covers data access with Spring Boot using the ToDo application from

previous chapters. You are going to make the ToDo app work with SQL and NoSQL

databases. Let’s get started.

SQL Databases

Do you remember those days when (in the Java world) you needed to deal with all the

JDBC (Java Database Connectivity) tasks? You had to download the correct drivers

and connection strings, open and close connections, SQL statements, result sets, and

transactions, and convert from result sets to objects. In my opinion, these are all very

manual tasks. Then a lot of ORM (object-relational mapping) frameworks started

to emerge to manage these tasks—frameworks like Castor XML, ObjectStore, and

Hibernate, to mention a few. They allowed you to identify the domain classes and create

XML that was related to the database’s tables. At some point, you also needed to be an

expert to manage those kinds of frameworks.

127

© Felipe Gutierrez 2019

F. Gutierrez, Pro Spring Boot 2, /10.1007/978-1-4842-3676-5_5

Chapter 5 Data aCCess with spring Boot

The Spring Framework helped a

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐