Spring JDBC components simplify JDBC-based data access by encapsulating the boilerplate code and hiding the interaction with JDBC API components from the developer with a set of simple interfaces. These interfaces handle the opening and closing of JDBC resources (connections, statements, resultsets) as required. They prepare and execute statements, extract results from resultsets, provide callback hooks for converting, mapping and handling data, handle transactions, and translate SQL exceptions into the more sensible and meaningful hierarchy of DataAccessException
.
Spring JDBC provides three convenient approaches for accessing relational databases:
JdbcTemplate
SimpleJDBC
classesRDBMS
Sql*
classes
Each of these Spring JDBC categories has multiple flavors of components under them which you can mix-and-match based on your convenience and technical choice. You may explore them under the org.springframework.jdbc
package and its subpackages.