Discussion Locked

Batch JDBC - increase processing speed

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Batch processing SQL statements can improve JDBC operation. Will you use this tip in your application development?

6 replies

by prkvl

Thanks for the idea. I would certainly use it in the
application development.

by sholmes

Where is the batching cached? Are the requests queued at the database server or the requesting client? I'm curious, because if it's the former, then wow, this is nice!

by bignath

In jdk 1.3.1 there is no such thing as the insert method for the java.sql.Statement package. Statement uses the same method as PreparedStatement (addBatch()) to add sql commands to a batch of commands for the Statement object.

by vision2002

In the given example only delete and insert are used. Can we use multiple select queries in batch returning multiple resulsets

by Mark W. Kaelin

I received this question - perhaps someone has an answer for a fellow Builder.com member?

**
Its really nice to know about the Batching SQL. But in the example given
are for the delete and insert SQL queries.
I want to know if this batching can be used to execute multiple "Select"
SQL queries and return those many resultsets.

by ashawver

I see in your example that you can batch a PreparedStatement with a simple insert like the following:
"INSERT INTO Users VALUES(?,?,?)"

Can you batch a PreparedStatement with a stored proc call (with return values) such as:
"? = CALL MyProc(?,?,?)"

I have tried this, but was unsuccessful. This would be a huge help if it worked.

This discussion is closed to new replies.