1. Querying a row of data and returning an int type result
jdbcTemplate.queryForInt("select count(*) from test");
2. Query a row of data and convert the row data to a map return
jdbcTemplate.queryForMap("select * from test where name=‘name5‘");
3. Query a row for any type of data, and the last parameter specifies the type of return result
jdbcTemplate.queryForObject("select count(*) from test", Integer.class);
4. Query a batch of data, by default convert each row of data to map
jdbcTemplate.queryForList("select * from test");
5. Query only one column of data list, column type is string, column name is name
jdbcTemplate.queryForList("select name from test where name=?", new Object[]{"name5"}, String.class);
6. Query a batch of data, returned as SqlRowSet, similar to resultset, but no longer bound to the connection
SqlRowSet rs = jdbcTemplate.queryForRowSet("select * from test");
Spring JdbcTemplate Query using