读书人

插入数据库异常

发布时间: 2013-03-19 17:22:05 作者: rapoo

插入数据库错误
严重: Servlet.service() for servlet default threw exception
java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`db_blog/critique`, CONSTRAINT `critique_ibfk_1` FOREIGN KEY (`AId`) REFERENCES `article` (`Id`))
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1269)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:955)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)


求教
[解决办法]
oreign key constraint fails (`db_blog/critique`, CONSTRAINT `critique_ibfk_1` FOREIGN KEY (`AId`) REFERENCES `article` (`Id`))

外键约束错误
[解决办法]
检查外键约束看看

读书人网 >Java Web开发

热点推荐