This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes JDBC batch statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC batch statement" Watch "JDBC batch statement" New topic
Author

JDBC batch statement

Sub swamy
Ranch Hand

Joined: Oct 02, 2002
Posts: 121
Am using JDBC batch statement in DB2 V8. Is there any way for me to know the number of statements that can be executed at the same time using statement.executeBatch() ? Is there any limit ? And what would be the exception if this limit is exceeded ?

Would appreciate if someone could throw more light into this.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32633
    
215

I don't know what the limit is, but one way to find out is to try it. Put the addBatch statement in a loop and see what happens. If any exception is thrown, it would be a SQLException.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
Originally posted by Jeanne Boyarsky:
I don't know what the limit is, but one way to find out is to try it. Put the addBatch statement in a loop and see what happens. If any exception is thrown, it would be a SQLException.


My money's on OutOfMemoryException...
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32633
    
215

Originally posted by stu derby:


My money's on OutOfMemoryException...

True. I was thinking along the lines of a hard coded limit. If it's a runtime thing, I agree with out of memory!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC batch statement
 
It's not a secret anymore!