Skip to Content
Hands-On Reactive Programming in Spring 5
book

Hands-On Reactive Programming in Spring 5

by Oleh Dokuka, Igor Lozynskyi
October 2018
Intermediate to advanced
556 pages
15h 18m
English
Packt Publishing
Content preview from Hands-On Reactive Programming in Spring 5

Spring JDBC

To simplify the hassle surrounding raw JDBC, Spring provides the Spring JDBC module, which is pretty old but well described. This module offers a few versions of the JdbcTemplate class that helps to execute queries and maps relational rows into entities. It also handles the creation and release of resources, helping to omit common errors such as forgetting to close a prepared statement or connection. JdbcTemplate also catches JDBC exceptions and translates them to generic org.springframework.dao exceptions.

Let's say we have a collection of books in an SQL database and the entity is represented by the following Java class:

class Book {
   private int id;
   private String title;

   public Book() { }

   public Book(int id, String title)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Spring Microservices in Action, Second Edition

Spring Microservices in Action, Second Edition

John Carnell, Illary Huaylupo Sanchez

Publisher Resources

ISBN: 9781787284951Supplemental Content