When the mysql database is upgraded from 4.x to 5.x, the driver package is upgraded from 2.x to 3.x, and the following error is reported during system operation:
Java. SQL. SQLException: Can not issue data manipulation statements with executeQuery ()
At com.mysql.jdbc.Statement.exe cuteQuery (Statement. java: 1111)
At org.apache.commons.dbcp.DelegatingStatement.exe cuteQuery (DelegatingStatement. java: 205)
At com. sinohub. persistence. schedule. SchedulePersistence. setContractConsignment (SchedulePersistence. java: 1218)
At com. sinohub. web. financing. lettercredit. ChangeConsignmentAction. actionPerform (ChangeConsignmentAction. java: 86)
At com. sinohub. web. common. BaseAction. perform (BaseAction. java: 111)
At org. apache. struts. action. ActionServlet. processActionPerform (ActionServlet. java: 1787)
At org. apache. struts. action. ActionServlet. process (ActionServlet. java: 1586)
At org. apache. struts. action. ActionServlet. doPost (ActionServlet. java: 510)
At javax. servlet. http. HttpServlet. service (HttpServlet. java: 709)
At javax. servlet. http. HttpServlet. service (HttpServlet. java: 802)
At org. apache. catalina. core. ApplicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 237)
At org. apache. catalina. core. ApplicationFilterChain. doFilter (ApplicationFilterChain. java: 157)
At com. sinohub. util. SetCharacterEncodingFilter. doFilter (SetCharacterEncodingFilter. java: 111)
At org. apache. catalina. core. ApplicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 186)
At org. apache. catalina. core. ApplicationFilterChain. doFilter (ApplicationFilterChain. java: 157)
At org. apache. catalina. core. StandardWrapperValve. invoke (StandardWrapperValve. java: 214)
At org. apache. catalina. core. StandardValveContext. invokeNext (StandardValveContext. java: 104)
At org. apache. catalina. core. StandardPipeline. invoke (StandardPipeline. java: 520)
At org. apache. catalina. core. StandardContextValve. invokeInternal (StandardContextValve. java: 198)
At org. apache. catalina. core. StandardContextValve. invoke (StandardContextValve. java: 152)
At org. apache. catalina. core. StandardValveContext. invokeNext (StandardValveContext. java: 104)
At org. apache. catalina. core. StandardPipeline. invoke (StandardPipeline. java: 520)
At org. apache. catalina. core. StandardHostValve. invoke (StandardHostValve. java: 137)
At org. apache. catalina. core. StandardValveContext. invokeNext (StandardValveContext. java: 104)
At org. apache. catalina. valves. ErrorReportValve. invoke (ErrorReportValve. java: 118)
At org. apache. catalina. core. StandardValveContext. invokeNext (StandardValveContext. java: 102)
At org. apache. catalina. core. StandardPipeline. invoke (StandardPipeline. java: 520)
At org. apache. catalina. core. StandardEngineValve. invoke (StandardEngineValve. java: 109)
At org. apache. catalina. core. StandardValveContext. invokeNext (StandardValveContext. java: 104)
At org. apache. catalina. core. StandardPipeline. invoke (StandardPipeline. java: 520)
At org. apache. catalina. core. ContainerBase. invoke (ContainerBase. java: 929)
At org. apache. coyote. tomcat5.CoyoteAdapter. service (CoyoteAdapter. java: 160)
At org. apache. coyote. http11.Http11Processor. process (Http11Processor. java: 799)
At org. apache. coyote. http11.Http11Protocol $ Http11ConnectionHandler. processConnection (Http11Protocol. java: 705)
At org.apache.tomcat.util.net. TcpWorkerThread. runIt (PoolTcpEndpoint. java: 577)
At org. apache. tomcat. util. threads. ThreadPool $ ControlRunnable. run (ThreadPool. java: 683)
At java. lang. Thread. run (Thread. java: 595)
After checking, it is found that the update statement is executed in the setContractConsignment () method in com. sinohub. persistence. schedule. SchedulePersistence, but statement calls the executeQuery () method. Change the executeQuery () method to execute.
This article from the CSDN blog, reprint please indicate the source: http://student.csdn.net/space.php? Uid = 227104 & do = blog & id = 40161