在做javaweb项目时,oracle表中的数据插入空的mysql表中出现了违反唯一约束:
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: 违反唯一约束条件 (BDCDJ_ZF.SYS_C0038554)
已经删除了mysql表中的数据,还是报这个错误,而且把java项目中的insert语句拿出来放在mysql中没有错误,百度了好久没有找到原因,求助
ringa_lee2017-04-17 17:47:16
It means that the primary key of the data in ORACLE may be duplicated, or it may be due to the definition of your Mysql field, which causes implicit conversion of the data inserted into Mysql, resulting in duplication of the originally unique data. First check whether the data in the primary key column or unique index column inserted into the Mysql table in ORACLE is duplicated. If not, check whether there is a problem with the field definition in the Mysql table.
ringa_lee2017-04-17 17:47:16
The questioner has inserted exactly the same data. (This may be the reason. I encountered this reason last time. It was exactly the same data when inserting, and even the unique ID was the same, so this error was reported).
To be simple and crude, just re-import the database.