Spring JDBC Framework simplifies the use of JDBC and helps to avoid common errors.
The following example shows using RowCountCallbackHandler class
which is an implementation of RowCallbackHandler interface.
/**
* Initialize context and get the JdbcTemplate
*/
ApplicationContext appContext = new ClassPathXmlApplicationContext("applicationContext.xml");
DataSource dataSource = (DataSource) appContext.getBean("dataSource");
JdbcTemplate template = new JdbcTemplate(dataSource);