Archive for ‘Spring Framework’

Using RowCallbackHandler in Spring JdbcTemplate

CallbackHandler is a interface used by JdbcTemplate’s query methods. This interface cantains only one method with the signature in the following code snippet. The implementation class of this interface needs to implements the processRow() method, which take responsibility to process each row of data in the ResultSet. The processRow() method should not call next()...

Full story

Using ResultSetExcractor in Spring JdbcTemplate

JdbcTemplate class includes query methods to prepare and execute the SQL queries. The Spring JDBC abstraction framewor provides three different types of callbacks to read the results after executing the SQL query using query() methods. ResultSetExtractor RowCallbackHandler RowMapper Let’s start our discussion with ResultSetExtractor. ResultSetExtractor contains only one method with the regnature shown in...

Full story

JdbcTemplate to execute SQL DML Statements

JdbcTemplate proveides update() methods for executing single SQL DML statement. It support JDBC statement and PreparedStatement style of eecuting the SQL statements. Following example demonstrates all the update methods of JdbcTemplate. To make this example simple, we are using ‘Product’ table. Following SQL Script show the table description. Following Dao Interface shows the minimum...

Full story

Copyright © 2013 JDBC Tutorial. All rights reserved.
Proudly powered by WordPress. Developed by 7tech Solutions