Query for object,
Student student = return jdbcTemplate.queryForObject("select * from student_id = ?", new Object[] { studentId }, studentRowMapper);
For query,
List<Student> students = return jdbcTemplate.query("select * from class_room_id = ?", new Object[] { classRoomId }, studentRowMapper);
Both jdbcTemplate.queryForObject
and jdbcTemplate.query
are deprecated in spring boot 2.4.X above
Object[]
. This is also explained in the@depracted
documentation. See docs.spring.io/spring-framework/docs/current/javadoc-api/org/… as well as explained in the upgrade documentation github.com/spring-projects/spring-framework/wiki/… – Auriferous