JDBC: Fix for executeLargeBatch() in Prepared Statements
Details
| Detail name | Value |
|---|---|
| Changelog Number | 26877 |
| Type | Bug |
| Status | Open |
| Affected Versions | Exasol 7.1.0 |
Description
The executeLargeBatch() method in AbstractEXAPreparedStatement class of JDBC driver was not implemented and inherited its behavior from EXAStatement. This caused an incompatibility due to differences in how batching is handled for normal statements versus prepared statements. When attempting to call executeLargeBatch() on a prepared statement, it resulted in the following exception:
com.exasol.jdbc.EXABatchUpdateException: Statement missing for batch execution. (Session: [session_id])
Workaround
The current workaround for this issue is to directly call executeLargeUpdate for prepared statements instead of using executeBatch() or executeLargeBatch().
This approach has the added benefit of returning the total number of affected rows, which is not possible when using executeBatch() or executeLargeBatch() due to their behavior of returning batch-specific success statuses (-2 for "unknown status").
Fix
The executeLargeBatch() method is now explicitly implemented in AbstractEXAPreparedStatement to support batched executions for prepared statements.