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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 726
How can I count the inserted records


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

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

Joined: Mar 22, 2008
Posts: 726
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: 19538
    
  16

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();
 
Similar Threads
Reverse Sentence
another problem with float's and double's
Running scheduler through thread
method call
c++ to Java