You are previewing Spring in Action, Third Edition.

Spring in Action, Third Edition

Cover of Spring in Action, Third Edition by Craig Walls Published by Manning Publications
O'Reilly logo

Chapter 5. Hitting the database


This chapter covers
  • Defining Spring’s data access support
  • Configuring database resources
  • Working with Spring’s JDBC templates
  • Using Spring with Hibernate and JPA


With the core of the Spring container now under your belt, it’s time to put it to work in real applications. A perfect place to start is with a requirement of nearly any enterprise application: persisting data. Every one of us has probably dealt with database access in an application in the past. In practice, we know that data access has many pitfalls. We have to initialize our data access framework, open connections, handle various exceptions, and close connections. If we get any of this wrong, we could potentially corrupt or delete valuable ...

The best content for your career. Discover unlimited learning on demand for around $1/day.