"Sedillo, Derek (Mission Systems)" <[EMAIL PROTECTED]> writes:

> Hello Daniel,
>
> Thank you for sharing your finding.  It is interesting to see that using
> executeBatch was actually slower than executeUpdate.
>
> Of these three approaches I find it hard to picture multiple inserts in
> a single transaction using executeUpdate.  Would you mind describing how
> to place multiple inserts into one transaction 'without' using batch
> processing?  I am still a bit new to this paradigm after coming from the
> Oracle/C++ world.

I haven't followed this thread closely, but is there a reason why you
cannot do:

PreparedStatement ps = 
conn.prepareStatement("insert into T values (?, ?, ?)");

conn.setAutoCommit(false);
for (int i = 0; i < 1000; ++i) {
    ps.setX(1, <whatever>);
    ps.setX(2, <whatever>); 
    ps.setX(3, <whatever>);
    ps.executeUpdate();
}
conn.commit();

?

-- 
dt

Reply via email to