This, handed to system.db.runPrepUpdate()
, will insert three rows at once:
INSERT INTO some_table (some_column1, some_column2, some_column3)
VALUES (?, ?, ?),
(?, ?, ?),
(?, ?, ?)
You would provide the nine arguments in a flat list.
You would construct the SQL dynamically with the right number of inserted row placeholders and the right number of JDBC substitution arguments. Just be careful not to exceed the limit on ?
placeholders. Some JDBC drivers choke at around 2000.