Book Image

SPRING COOKBOOK

Book Image

SPRING COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


JDBC (Java Database Connectivity) and Hibernate are the two most commonly used technologies to query a database from a Spring application.

For small projects and simple data models, JDBC is straightforward; you write your SQL queries yourself and Spring provides helpers to convert the query results into objects.

For complex data models, with several relationships between classes, Hibernate is easier; you deal with a standard Java framework (still using JDBC behind the scenes) that will generate the SQL queries for you.

This chapter focuses on JDBC because Spring doesn't change the normal way of using Hibernate. The integration of Hibernate with Spring, however, is covered in the Using Hibernate for powerful object persistence and querying recipe.