I have a stored procedure in an Oracle 11g database like f(a IN, b IN, c OUT).
I want to call it from JDBC in batch mode and then read all the OUT variables.
Is this possible?
I have this so far
CallableStatement statement = connection.prepareCall("f(?, ?, ?)");
for(Item i : items) {
int i = 0;
statement.setString(++i, item.getA());
statement.setString(++i, item.getB());
statement.registerOutParameter(++i, Types.NUMERIC);
statement.addBatch();
}
statement.executeBatch();
int[] answers = ?
Thanks
Sadly, no.
The ability to make batch updates is the same for CallableStatement objects as it is for PreparedStatement objects. In fact, a CallableStatement object is restricted to the same functionality that a PreparedStatement object has. More precisely, when using the batch update facility, a CallableStatement object can call only stored procedures that take input parameters or no parameters at all.
Reference: http://docs.oracle.com/javase/1.4.2/docs/guide/jdbc/getstart/callablestatement.html#1000220
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With