目前我使用JdbcTemplate.update()
方法来执行存储过程,它基本上更新并插入一些记录,它不返回任何东西。 但我不确定是否使用update()
方法执行存储过程的良好做法。使用该方法有什么缺点吗? 还是必须使用方法?我试图避免实现execute(),因为它会在我的应用程序中需要很多代码更改。使用JdbcTemplate.update()执行存储过程是否是一个好习惯?
代码:
jdbcTemplate.update("call test_stored_proc(? , ?)", new Long[] {
userId, statusId });
因此'update()'在内部调用Statement.executeUpdate()方法? – Rehman
好的。得到它了 。它调用Statement.executeUpdate()。感谢你的回答 – Rehman