Home > database >  Mysql foreign key error occurs, a great god for answers
Mysql foreign key error occurs, a great god for answers

Time:09-21

Java. SQL. BatchUpdateException: always add or update a child row: a foreign key constraint fails (` onlinetest `. ` bus_answer `, constraint ` que_id ` foreign key (` que_id `) REFERENCES ` bus_question ` (` que_id `) ON DELETE CASCADE ON the update CASCADE)
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance0 (Native Method)
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance (NativeConstructorAccessorImpl. Java: 62)
At sun. Reflect. DelegatingConstructorAccessorImpl. NewInstance (DelegatingConstructorAccessorImpl. Java: 45)
The at Java. Lang. Reflect. Constructor. NewInstance (423) Constructor. Java:
At com. Mysql. JDBC. Util. HandleNewInstance (Util. Java: 425)
At com. Mysql. JDBC. Util. GetInstance (Util. Java: 408)
At com. Mysql. JDBC. SQLError. CreateBatchUpdateException (SQLError. Java: 1163)
At com. Mysql. JDBC. StatementImpl. ExecuteBatchInternal (StatementImpl. Java: 1060)
At com. Mysql. JDBC. StatementImpl. ExecuteBatch (StatementImpl. Java: 970)
At com, the online service. The BusinessService. InsertQuestionAndAnswers (245) the BusinessService. Java:
At com. Online. Servlet3. Business. BusinessQuestionServlet2. DoPost (BusinessQuestionServlet2. Java: 159)
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 660)
The at javax.mail. Servlet. HTTP. HttpServlet. Service (HttpServlet. Java: 741)
The at org. Apache. Catalina. Core. ApplicationFilterChain. InternalDoFilter (ApplicationFilterChain. Java: 231)
The at org. Apache. Catalina. Core. ApplicationFilterChain. DoFilter (ApplicationFilterChain. Java: 166)
At org, apache tomcat, websocket server WsFilter. DoFilter (53) WsFilter. Java:
The at org. Apache. Catalina. Core. ApplicationFilterChain. InternalDoFilter (ApplicationFilterChain. Java: 193)
The at org. Apache. Catalina. Core. ApplicationFilterChain. DoFilter (ApplicationFilterChain. Java: 166)
At com. Online. Filter. URLEncodeFilter. DoFilter (URLEncodeFilter. Java: 27)
The at org. Apache. Catalina. Core. ApplicationFilterChain. InternalDoFilter (ApplicationFilterChain. Java: 193)
The at org. Apache. Catalina. Core. ApplicationFilterChain. DoFilter (ApplicationFilterChain. Java: 166)
The at org. Apache. Catalina. Core. StandardWrapperValve. Invoke (StandardWrapperValve. Java: 199)
The at org. Apache. Catalina. Core. StandardContextValve. Invoke (StandardContextValve. Java: 96)
The at org. Apache. Catalina. The authenticator. AuthenticatorBase. Invoke (AuthenticatorBase. Java: 502)
The at org. Apache. Catalina. Core. StandardHostValve. Invoke (StandardHostValve. Java: 140)
The at org. Apache. Catalina. Valves. ErrorReportValve. Invoke (ErrorReportValve. Java: 81)
The at org. Apache. Catalina. Valves. AbstractAccessLogValve. Invoke (AbstractAccessLogValve. Java: 651)
The at org. Apache. Catalina. Core. StandardEngineValve. Invoke (StandardEngineValve. Java: 87)
At org. Apache. Catalina. Connector. CoyoteAdapter. Service (342) CoyoteAdapter. Java:
At org. Apache. Coyote. Http11. Http11Processor. Service (501) Http11Processor. Java:
The at org. Apache. Coyote. AbstractProcessorLight. Process (AbstractProcessorLight. Java: 66)
The at org. Apache. Coyote. AbstractProtocol $ConnectionHandler. Process (AbstractProtocol. Java: 754)
At org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun NioEndpoint. Java: (1376)
The at org.apache.tomcat.util.net.SocketProcessorBase.run (SocketProcessorBase. Java: 49)
The at Java. Util. Concurrent. ThreadPoolExecutor. RunWorker (ThreadPoolExecutor. Java: 1149)
The at Java. Util. Concurrent. ThreadPoolExecutor $Worker. The run (ThreadPoolExecutor. Java: 624)
At org, apache tomcat. Util. Threads. TaskThread $WrappingRunnable. Run (61) TaskThread. Java:
The at Java. Lang. Thread. The run (Thread. Java: 748)
Under Caused by: com. Mysql. JDBC. Exceptions. Jdbc4. MySQLIntegrityConstraintViolationException: always add or update a child row: a foreign key constraint fails (` onlinetest `. ` bus_answer `, constraint ` que_id ` foreign key (` que_id `) REFERENCES ` bus_question ` (` que_id `) ON DELETE CASCADE ON the update CASCADE)
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance0 (Native Method)
At sun. Reflect. NativeConstructorAccessorImpl. NewInstance (NativeConstructorAccessorImpl. Java: 62)
At sun. Reflect. DelegatingConstructorAccessorImpl. NewInstance (DelegatingConstructorAccessorImpl. Java: 45)
The at Java. Lang. Reflect. Constructor. NewInstance (423) Constructor. Java:
At com. Mysql. JDBC. Util. HandleNewInstance (Util. Java: 425)
At com. Mysql. JDBC. Util. GetInstance (Util. Java: 408)
At com. Mysql. JDBC. SQLError. CreateSQLException (SQLError. Java: 936)
At com. Mysql. JDBC. MysqlIO. CheckErrorPacket (MysqlIO. Java: 3973)
At com. Mysql. JDBC. MysqlIO. CheckErrorPacket (MysqlIO. Java: 3909)
At com. Mysql. JDBC. MysqlIO. SendCommand (MysqlIO. Java: 2527)
At com. Mysql. JDBC. MysqlIO. SqlQueryDirect (MysqlIO. Java: 2680)
At com. Mysql. JDBC. ConnectionImpl. ExecSQL (ConnectionImpl. Java: 2480)
At com. Mysql. JDBC. StatementImpl. ExecuteUpdateInternal (StatementImpl. Java: 1552)
At com. Mysql. JDBC. StatementImpl. ExecuteBatchInternal (StatementImpl. Java: 1034)
. 30 more
I want to put the question and answer table and data at the same time, but this error, check the information that can empty data, but the problem still exists, and the great spirit refers to the waynullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related