Spring JDBC - bhudevi0924/Spring-boot GitHub Wiki

Introduction:

  • JDBC simplifies the database access in Java applications.
  • It provides a higher-level abstraction over JDBC (Java Database Connectivity), which is the standard Java API for database access.
  • Follows template based approach.
  • Spring JDBC simplifies exception handling by converting SQLExceptions into more generic, unchecked DataAccessExceptions.
  • Spring JDBC provides an extension to JdbcTemplate called NamedParameterJdbcTemplate, which allows parameterized SQL queries using named parameters instead of traditional '?' placeholders.
  • To map rows of a ResultSet to Java objects, Spring JDBC provides the RowMapper interface.
  • Spring JDBC supports batch operations, allowing developers to execute multiple SQL statements in a single batch for improved performance.
  • One of the key advantages of Spring JDBC is its seamless integration with other modules of the Spring Framework, such as Spring Core, Spring MVC, and Spring Boot.