@Override
public Integer add(Board board) {
String sql = "INSERT INTO tz_board(title, description) VALUES(?,?)";
jdbcTemplate.update(sql, board.getTitle(), board.getDescription());
Integer boardId = jdbcTemplate.
return boardId;
}
不知道我这样写对不对
Integer boardId = jdbcTemplate.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
Spring提供了一个接口
其中有方法
方法描述
是滴,如楼上所言
org.springframework.jdbc.support.KeyHolder
的getKey()
方法返回注解,具体看如下例子http://bailong139.blog.163.com/blog/static/207238100201331383516951/