• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Counting .executeBatch();

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I count the inserted records


[ April 11, 2008: Message edited by: Fred Rosenberger ]
 
Campbell Ritchie
Sheriff
Posts: 48386
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . by adding count++; as a line in your for-loop?
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
. . . by adding count++; as a line in your for-loop?


Thanks a lot
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or look at the return value of executeBatch. That's an int[]:
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.

Just add those values and you should get the answer as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic