Spring JDBC - Last inserted id

前端 未结 2 1932
不知归路
不知归路 2021-01-16 06:46

I\'m using Spring JDBC. Is a simple way to get last inserted ID using Spring Framework or i need to use some JDBC tricks ?

jdbcTemplate.update(\"insert into          


        
2条回答
  •  情歌与酒
    2021-01-16 07:18

    The old/standard way is to use call currval() after the insert (ref). Simple and secure.

提交回复
热议问题