posts - 241,  comments - 116,  trackbacks - 0

The Following Exception is really Frequency When we Using Oracle.

1. ORA-02292: integrity constraint (IPCUSER.STUDENT_STUDENTCARD_FK) violated - child record found

如果你从表中删除一行,由另一个表中引用此行的一列,然后这个异常被throwed。

堆栈跟踪信息:
java.sql.SQLException: ORA-02292: integrity constraint (IPCUSER.STUDENT_STUDENTCARD_FK) violated - child record found
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1726)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1696)
    at com.tibco.ipc.utils.TESTClient.main(TESTClient.java:48)

 2. ORA-02291: integrity constraint (IPCUSER.STUDENT_STUDENTCARD_FK) violated - parent key not found

 

如果插入行到表(table_a),这行有一个外键称为另一个表(table_b)和外键的值不能从另一个表(table_b)发现,那么这个异常被thowed。

堆栈跟踪信息:
java.sql.SQLException: ORA-02291: integrity constraint (IPCUSER.STUDENT_STUDENTCARD_FK) violated - parent key not found
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1726)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1696)
    at com.tibco.ipc.utils.TESTClient.main(TESTClient.java:48)

 3. ORA-00001: unique constraint (IPCUSER.STUDENTCARD_HID_PK) violated

如果插入行到一个表,此行的第一列是主键,主键,如果你要插入的表已经存在,这种异常被throwed。

堆栈跟踪信息:
java.sql.SQLException: ORA-00001: unique constraint (IPCUSER.STUDENTCARD_HID_PK) violated
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1726)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1696)
    at com.tibco.ipc.utils.TESTClient.main(TESTClient.java:46)

 

posted on 2011-07-06 09:11 墙头草 阅读(555) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
人人游戏网 软件开发网 货运专家