Technology: Spring JDBC templates

Overview

When accessing a datasource, such as a database, one discovers that most of the code always stays the same: A connection to the database has to be established, a statement prepared, filled with parameters, the query has to be executed, the result has to be fetched and then mapped to a data object. Also, error-handling mechanisms, pooling of connections and other concerns reoccur in most situations when you access a database.

One part of the popular Spring framework is the spring JDBC package. It handles most of the so-called service code, meaning the code of DAOs that always remains the same, no matter what query is employed.

Reference

The Spring Framework has an excellent online documentation that covers Springs' JDBC functionality in Chapter 11: Data access using JDBC.

The API documentation for Spring (look for the package org.springframework.jdbc and it's sub-packages) can be found here: http://static.springframework.org/spring/docs/2.0.x/api/index.html.