JdbcTemplate “queryForObject” 和 “query” 在春季被弃用。它应该被什么取代?
2022-09-03 04:12:22
查询对象,
Student student = return jdbcTemplate.queryForObject("select * from student_id = ?", new Object[] { studentId }, studentRowMapper);
对于查询,
List<Student> students = return jdbcTemplate.query("select * from class_room_id = ?", new Object[] { classRoomId }, studentRowMapper);
两者都已在上述的 Spring boot 2.4.X 中弃用jdbcTemplate.queryForObject
jdbcTemplate.query