On 11/3/05, Steven Pannell <[EMAIL PROTECTED]> wrote:
Hi,
Is there a faster way of performing bulk inserts?
currently I do something like:
for(int i=1;i < list.size(); i++) {
MyObject object = list.get(i);
sqlMapClient.insert("myInsert", object);
}
This seems to take forever! Is is possible to pass the complete list or
something to save on parsing the statement and getting releasing the
connection for every insert statement??
thx.
Steve.
Hi,
There's no way to insert List to a Dbase.But you can use executeBatch provided by iBatis inorder to improve the performance and the network traffic.
sqlMapClient.startBatch();
for(int i=1;i < list.size(); i++) {
MyObject object = list.get(i);
sqlMapClient.insert("myInsert", object);
}
int no_rows_inserted = sqlMapClient.executeBatch();