Error java.sql.BatchUpdateException: ORA-00001: Unique Constraint Violated
Last updated on MARCH 09, 2018
Applies to:JDBC - Version: 10.2.0.4.0 to 22.214.171.124.0
This problem can occur on any platform.
-- Problem Statement:
When using JDBC standard batching and inserting rows into a table with a "where not exists" condition where:
- first row does not exist resulting in an insert
- second row does exists and should not be inserted because of the "where not exists" condition but
JAVA.SQL.BATCHUPDATEEXCEPTION: ORA-1: UNIQUE CONSTRAINT (SCOTT.SYS_C009652)
This only happens when running the JDBC program against an Oracle 126.96.36.199.0 or 188.8.131.52.0 database.
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