一.EmptyResultDataAccessException
- 字义:
-
空结果数据访问异常
- 提示:
-
Incorrect result size: expected 1, actual 0
- 解决:将指定的向数据库查询的代码进行抛异常
try { loginUser = template.queryForObject(sql, new BeanPropertyRowMapper<>(User.class), user.getUsername(), user.getPassword()); } catch (DataAccessException e) { e.printStackTrace(); }