Re: Problem batching DB2 stored procedure calls using JDBC





usenet@xxxxxxxxxx wrote:

Hi.

I have a DB2 stored procedure that I call using JDBC. Now I'm trying to
batch the call. This is done by the book:

stmt = connection.prepareCall(" ... ");

stmt.setString(1, "foo");
stmt.addBatch();

stmt.setString(1, "bar");
stmt.addBatch();

stmt.setString(1, "baze");
stmt.addBatch();

stmt.executeBatch();

It appears that the stored procedure only gets invoked once - so after
the above there's only one record in the table the SP writes to, namely
the first ("foo"). The stmt.executeBatch(); returns an array of size 3,
all 0's.

Using same methodology I can make batching of prepared statements work
fine.

Any tips?

That should work, so I'd contact IBM about the driver. Joe


Thanks.

Morten


.