aspose file tools*
The moose likes Beginning Java and the fly likes Counting .executeBatch(); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Counting .executeBatch();" Watch "Counting .executeBatch();" New topic
Author

Counting .executeBatch();

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 740
How can I count the inserted records


[ April 11, 2008: Message edited by: Fred Rosenberger ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
. . . by adding count++; as a line in your for-loop?
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 740
Originally posted by Campbell Ritchie:
. . . by adding count++; as a line in your for-loop?


Thanks a lot
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Counting .executeBatch();