Hi,

I'm using batched statements to insert data into DB2 Version7 on Sun-Solaris, COM.ibm.db2.jdbc.app.DB2Driver:

PreparedStatement statement = ...; // insert statement
for (int ....) // outer loop (approx. 10000 times)
{
for (int ....) // inner loop (approx. 20 times)
{
statement.setInt (1, a);
statement.setInt (2, b);
statement.setString(3, c);
statement.setInt (4, d);
statement.addBatch();
}
statement.executeBatch();
statement.clearBatch();

connection.commit();
}

PROBLEM: The data gets mixed when inserted in the DB,
e.g. if third parameter is set to "Frankfurt" and to "Bishops Startford" in consecutive iterations, "FrankfurtStartford" gets inserted!!

Has anybody encountered the same problem - DB2 mixing up values of batched statements?

Thanks

Sven