Introduction to Spring Framework JDBC:-
Earlier working with database using plain old JDBC, it becomes cumbersome to
write unnecessary code to handle exceptions, opening and closing database
connections etc. But Spring JDBC Framework takes care of all the low-level
details starting from opening the connection, prepare and execute the SQL
statement, process exceptions, handle transactions and finally close the
connection.
So what you have do is just define connection parameters and specify the SQL statement to be executed and do the required work for each iteration while fetching data from the database.
Spring JDBC provides several approaches and correspondingly different
classes to interface with the database. I'm going to take classic and the most
popular approach which makes use of JdbcTemplateclass of the framework. This is
the central framework class that manages all the database communication and
exception handling.