Support databases that return SUCCESS_NO_INFO upon batch execution

The PreparedStatement.executeBatch method may return a general success
indicator SUCCESS_NO_INFO. For example, this is the case for Oracle or
SAP MaxDB. If SUCCESS_NO_INFO is returned, the number of database rows
updated or deleted by a particular row of the prepared statement batch
cannot be determined. In particular it is not known whether 0 or 1 rows
have been updated as updating 0 rows is a successful statement execution
as well, from JDBC's point of view. Gwtorm, however, will interpret
SUCCESS_NO_INFO as a failure. Consequently, on a database returning
SUCCESS_NO_INFO, any INSERT, UPDATE or DELETE operation will fail.

Furthermore, to implement the UPSERT functionality, firstly updates are
attempted. For rows that could not be updated successfully, an insert
will be performed. Here, it is necessary to determine the exact update
count for individual items. If this is not possible for a particular SQL
dialect (as it returns SUCCESS_NO_INFO), updates need to be attempted
individually.

To determine, if update batching can safely be used, the SQLDialect is
equipped with a method to indicate whether batch execution allows to
determine the exact batch update counts for individual rows.

Change-Id: I779f5a70acbb1886ea7be003a322970f7d7efb0e
Signed-off-by: Adrian Goerler <adrian.goerler@sap.com>
5 files changed