This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes addBatch() 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 » Databases » JDBC
Bookmark "addBatch()" Watch "addBatch()" New topic
Author

addBatch()

pavan mane
Greenhorn

Joined: Oct 23, 2006
Posts: 19
hi,
I am using addBatch() & executeBatch(), i want to identify which execution among the batch has failed! is it possible? please explain.
Note :
I am using Oracle10g db and ojdbc14.jar
[ May 15, 2007: Message edited by: pavan mane ]

- Pavan Mane<br /> Certifications -<br /> * SCJP5.0(Tamed The Tiger Grr..)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
134

Originally posted by pavan mane:
i want to identify which execution among the batch has failed! is it possible?

It depends on what you mean by fail. If you mean failed to update anything, you can look at the result of executeBatch. It returns a count of updated rows for each statement. If you mean an actual SQLException, then no - there isn't a way to find out which statement caused it.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
pavan mane
Greenhorn

Joined: Oct 23, 2006
Posts: 19
Thank you, Jeanne!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: addBatch()
 
Similar Threads
how to use executeBatch () inservlet?
Problem with batch updates
JDBC addBatch problem
addbatch with jdbc insert
prepared statement in for loop