Pages

Sunday, March 31, 2013

Spring Data Support

Introduction to Spring Data and Setting Up  
This tutorial serves as an introduction to Spring Data support. We'll also install a lightweight database Apache Derby that we'll use in subsequent tutorials. We'll learn how to start Derby in Network server mode, and how to connect and run SQL queries using the ij client tool.

Using JDBC without Spring  
We'll now implement a simple DAO class that fetches data from the database using JDBC. We'll look at all the boilerplate code we need to write to establish connections, execute queries, close objects and handle exceptions.
Adding Spring and DataSource Configuration  
We'll now add the Spring framework to our JDBC project. We'll add dependency injection to our Main and DAO class. We'll also learn how to configure DataSource as a Spring bean and supply connection parameters to it in the XML file.
Using JdbcTemplate  
We'll use the JdbcTemplate class provided by Spring to implement a DAO method. We'll see how using the template class makes the DAO methods simple, and how it takes care of much of the boilerplate code we'd have to write otherwise.
Returning Other Datatypes from JdbcTemplate  
We returned an integer datatype result from our query in the previous tutorial. In this tutorial, we'll learn how to return other datatypes. We'll implement a method that returns a String query output.
Implementing RowMapper  
In this tutorial, we implement a custom RowMapper class to map our domain objects. We then use this class to write fetch methods that return custom model objects.
Performing Write Operations with JdbcTemplate  
We'll now implement some database write operations. We'll write a DAO method to update a value in the database, as well as use the execute() method to run a DDL SQL query.
Named Parameter JDBC Template  
We'll use the NamedParameterJdbcTemplate class to run queries with named placeholders.
DAO Support Classes  
We'll wrap up discussion on the Spring JDBC support by using the DAO support classes that Spring provides out of the box. We'll see how this makes our DAO classes cleaner than ever.
Using Hibernate with Spring  
In this video, we'll learn how to integrate the Hibernate framework in our Spring application. We'll create a SessionFactory as a Spring singleton and use that in our DAO class to work with the database.

No comments:

Post a Comment