Hello,

I'm inserting a lot of records into SAPDB via JDBC.

More / less like this:

String sql = "INSERT INTO my_table VALUES(?)";
PreparedStatement pstmt = connection.prepareStatement(sql);

// Insert rows of data
for (int i=0; i< batchSize; i++) {
   pstmt.setString(1, ""+i);
   pstmt.addBatch();
}

// Execute the batch
pstmt.executeBatch();

The performance observed varies substantially depending on the batch size.

Is there a way to determine the optimal batch size for a given table?

Or maybe a way to tell wether I should keep on adding statements to the
current batch?

Is this related to some internal buffer size? Should I increase it
(somehow)?


Thanks,
Wojtek Narczynski


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to