jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 732
How can I count the inserted records


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

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

Joined: Mar 22, 2008
Posts: 732
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: 19649
    
  18

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