http://old.nabble.com/Oracle---INSERT-UPDATE-RETURNING-INTO-td15772285.html
He ends up using an anonymous PL/SQL block also. The problems with
using a prepared statement are that (1) doing so is an Oracle extension,
not standard JDBC, so you need to use OraclePreparedStatement, and (2)
while the return type indicates the datatype of an individual result,
the actual data passed back by Oracle is a ResultSet; you need to
iterate over it to retrieve your return value.
Since iBATIS doesn't support vendor extensions*, the anonymous PL/SQL
block is the way to go.
* Blue-skying for a moment, statementType is currently restricted to
STATEMENT, PREPARED, or CALLABLE. If we leave that alone for
compatibility, we could define another attribute "extension" that
contains a fully qualified class name that must extend the specified
statementType. Then we might be able to handle vendor extensions in a
clean way (at least simple ones such as the one we are discussing here.)
--
Guy Rouillier