获取数据库表id最大值的方法

1.@Resource
  private JdbcTemplate jdbcTemplate;

2.Long maxId = jdbcTemplate.queryForObject(String.format("SELECT MAX(ID) FROM  表名"), Long.class);

猜你喜欢

转载自blog.csdn.net/weixin_42873742/article/details/84580317