Class JdbcPerunTemplate

All Implemented Interfaces:
InitializingBean, JdbcOperations

public class JdbcPerunTemplate extends JdbcTemplate
Class JdbcPerunTemplate extends JdbcTemplate from spring. - it has 1 additional method queryForObject(String sql, ResultSetExtractor rse, Object... args)
Sona Mastrakova
  • Constructor Details

    • JdbcPerunTemplate

      public JdbcPerunTemplate(DataSource perunPool)
  • Method Details

    • queryForInt

      public int queryForInt(String sql, Object... args)
      Implements a method removed from spring-jdbc
      sql - SQL query
      args - arguments for the SQL query
      result of the query or zero if null
    • queryForObject

      public <T> T queryForObject(String sql, ResultSetExtractor<? extends List<T>> rse, Object... args)
      Returns one object from the query, else throws an exception.
      sql - sql query
      rse - result set extractor that returns List of objects
      args - arguments for the query
      the single object obtained from the query
      IncorrectResultSizeDataAccessException - if more than one element has been found in the given Collection
      EmptyResultDataAccessException - if no element at all has been found in the given Collection