Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between Spring Data and JDBC/ORM modules

I'm starting a new Java Web project using Spring and obviously I need data access in my application.

In previous applications I used JDBC or ORM modules of Spring framework to implement my data access layer, but some times ago I read about Spring Data project. I'm curious about it and I'd like to know the diffenrences between the two projects and understand if there are advantages passing from one approach to the other.

like image 206
davioooh Avatar asked Feb 24 '26 04:02

davioooh


1 Answers

Spring data provides several functionalities:

  • Common functionality related to database applications - Defining a "repository" element (similar to DAO) with various functionalities, audit trail, etc.
  • JdbcTemplate like support for various NoSQL databases - MongoDB, Redis, Neo4J, and there are several community projects for other databases
  • High level functionality for JDBC (mostly Oracle) and JPA to reduce boilerplate code

Spring data also aims to save boilerplate code, as the repositories are defined as interfaces and the implementation is given by spring based on the method names.

like image 173
David Rabinowitz Avatar answered Feb 26 '26 18:02

David Rabinowitz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!