4

Suppose I insert ten rows to a table using batch update. I think it is possible to get all the ten generated keys using JDBC PreparedStatement method-

ResultSet getGeneratedKeys()

But how to achieve this with the spring framework? The SimpleJDBCInsert class has executeAndReturnKey() method, that works fine for one row insert at a time. But is there a way to do it for batch inserts ie., when using the executeBatch() method?

4

0 回答 0