Search code examples
mysqlspring-mvcjdbctemplate

How to extract column values from a record


Which function of JdbcTemplate to use to extract the column values from a record which is returned by the SQL in a spring MVC Web Application


Solution

  • There are a few options available, it depends on the context of the your code and the data you're retrieving. Have a look at the JdbcTemplate API, in particular the query methods. In most cases you will need to define either a RowMapper or ResultSetExtractor for the model you're populating.