Skip to content

3.2 Working with Spring Data JDBC

The Spring Data project is a rather large umbrella project comprising several subprojects, most of which are focused on data persistence with a variety of different database types. A few of the most popular Spring Data projects include these:

  • Spring Data JDBC —— JDBC persistence against a relational database
  • Spring Data JPA —— JPA persistence against a relational database
  • Spring Data MongoDB —— Persistence to a Mongo document database
  • Spring Data Neo4j —— Persistence to a Neo4j graph database
  • Spring Data Redis —— Persistence to a Redis key-value store
  • Spring Data Cassandra —— Persistence to a Cassandra column store database

One of the most interesting and useful features provided by Spring Data for all of these projects is the ability to automatically create repositories, based on a repository specification interface. Consequently, persistence with Spring Data projects has little or no persistence logic and involves writing only one or more repository interfaces.

Let’s see how to apply Spring Data JDBC to our project to simplify data persistence with JDBC. First, you’ll need to add Spring Data JDBC to the project build.

Released under the MIT License.