tags:

views:

99

answers:

1

I am using JDBC and want to batch insert, but I need the generated keys for the next round of inserts - is there anyway to accomplish this?

MapSqlParameterSource[] batchArgs ....

DAL.getNamedParameterTemplate().batchUpdate("INSERT INTO...", batchArgs);

Thanks

A: 

Use db sequences to grab the next primary key value and use it in the insert statement.

Boris Pavlović
how can i use that with spring?
MalcomTucker
something along these lines:select seq.nextval into nextPrimaryKeyValue
Boris Pavlović