Imagine that I have 100 SELECT queries that differ by one input. A PreparedStatement can be used for the value.
All the documentation I see on the Web is for batch
As pointed out in other answers the JDBC Batch Updates does not work for SELECT
queries or is at least not meant to be used for that.
Since the question however mentions DB2 as the RDBMS, I think it is worth pointing out here (albeit a bit late now...), that the official driver for this particular database actually does offer this feature using DB2PreparedStatement#executeDB2QueryBatch()
(see documentation for details). I am not aware of any other JDBC driver with this feature.