DEVFYI - Developer Resource - FYI

Is there a practical limit for the number of SQL statements that can be added to an instance of a Statement object

JDBC Interview Questions and Answers


(Continued from previous question...)

Is there a practical limit for the number of SQL statements that can be added to an instance of a Statement object

While the specification makes no mention of any size limitation for Statement.addBatch(), this seems to be dependent, as usual, on the driver. Among other things, it depends on the type of container/collection used. I know of at least one driver that uses a Vector and grows as needed. I've seen questions about another driver that appears to peak somewhere between 500 and 1000 statements. Unfortunately, there doesn't appear to be any metadata information regarding possible limits. Of course, in a production quality driver, one would expect an exception from an addBatch() invocation that went beyond the command list's limits.

(Continued on next question...)

Other Interview Questions