NullPointerException Occurs When Executing clearBatch() Method Without Calling addBatch() Method (Doc ID 1982179.1)

Last updated on JULY 26, 2017

Applies to:

JDBC - Version 11.2.0.4.0 to 11.2.0.4.0 [Release 11.2]
Information in this document applies to any platform.

Symptoms

 NullPointerException occurs when executing clearBatch() method without calling addBatch() method:

  java.lang.NullPointerException
    at oracle.jdbc.driver.OracleStatement.clearBatchItems(OracleStatement.java:4347)
    at oracle.jdbc.driver.OracleStatement.clearBatch(OracleStatement.java:4413)
    at oracle.jdbc.driver.OracleStatementWrapper.clearBatch(OracleStatementWrapper.java:206)
        ...

The simple example for this issue is as follows:
 

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms