O'Reilly logo

Just Spring by Madhusudhan Konda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Spring Data

Data persistence and retrieval are inevitable operations in an enterprise world. The advent of JDBC paved the way to interact with multiple databases with ease and comfort. JDBC techlogies have gained popularity in no time because of their unified API to access any database, be it MySQL or Oracle or Sybase or any Relational Database System.

Spring took one step ahead and created an even lighter framework, abstracting the JDBC behind the scenes. Although the JDBC and Spring marriage makes a happy family, there are some unsophisticated or unavailable features from the joint venture. One feature that comes to mind is the support for Object Relational mappings. We still have to write plain old SQL statements to access the data from persistent stores. This is the opportunity Hibernate grabbed and became an instant hit! With millions of downloads over the time, it is now a popular and powerful open source framework. Spring added more abstraction on top of the already powerful Hibernate to make it even better.

This chapter explains how the Spring Framework can be used effectively for accessing databases, without even having to worry about connections and statements. We then continue on to Spring’s ORM support, using Hibernate.

JDBC and Hibernate

The joint venture did not attempt to bridge the gap between Objects and Relational Data. JDBC is certainly one of the first-hand choices for a Java developer when working with databases. JDBC abstracts away the intricacies involved ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required