目前我使用JdbcTemplate.update()
方法來執行存儲過程,它基本上更新並插入一些記錄,它不返回任何東西。 但我不確定是否使用update()
方法執行存儲過程的良好做法。使用該方法有什麼缺點嗎? 還是必須使用方法?我試圖避免實現execute(),因爲它會在我的應用程序中需要很多代碼更改。使用JdbcTemplate.update()執行存儲過程是否是一個好習慣?
代碼:
jdbcTemplate.update("call test_stored_proc(? , ?)", new Long[] {
userId, statusId });
因此'update()'在內部調用Statement.executeUpdate()方法? – Rehman
好的。得到它了 。它調用Statement.executeUpdate()。感謝你的回答 – Rehman