告诉我是sql语句错误我看了半天也没看出来哪里错了在保存的时候点击保存就是空白页面
D:\apache-tomcat-8.5.51\bin\catalina.bat run
[2020-04-01 05:21:57,833] Artifact icake:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake"
Using CATALINA_HOME: "D:\apache-tomcat-8.5.51"
Using CATALINA_TMPDIR: "D:\apache-tomcat-8.5.51\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_231"
Using CLASSPATH: "D:\apache-tomcat-8.5.51\bin\bootstrap.jar;D:\apache-tomcat-8.5.51\bin\tomcat-juli.jar"
01-Apr-2020 17:21:59.274 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.鏈嶅姟鍣ㄧ増鏈: Apache Tomcat/8.5.51
01-Apr-2020 17:21:59.276 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏈嶅姟鍣ㄦ瀯寤: Feb 5 2020 22:26:25 UTC
01-Apr-2020 17:21:59.276 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏈嶅姟鍣ㄧ増鏈彿(锛8.5.51.0
01-Apr-2020 17:21:59.276 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.鐗堟湰: 10.0
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log 鏋舵瀯: amd64
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 鐜鍙橀噺: C:\Program Files\Java\jdk1.8.0_231\jre
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 鐗堟湰: 1.8.0_231-b11
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.渚涘簲鍟: Oracle Corporation
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake
01-Apr-2020 17:21:59.277 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\apache-tomcat-8.5.51
01-Apr-2020 17:21:59.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake\conf\logging.properties
01-Apr-2020 17:21:59.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
01-Apr-2020 17:21:59.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
01-Apr-2020 17:21:59.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
01-Apr-2020 17:21:59.278 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
01-Apr-2020 17:21:59.279 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake\jmxremote.password
01-Apr-2020 17:21:59.279 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake\jmxremote.access
01-Apr-2020 17:21:59.279 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\dell\.IntelliJIdea2019.3\system\tomcat\Unnamed_icake
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\apache-tomcat-8.5.51
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\apache-tomcat-8.5.51\temp
01-Apr-2020 17:21:59.280 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0].
01-Apr-2020 17:21:59.283 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
01-Apr-2020 17:21:59.283 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL閰嶇疆锛歶seAprConnector[false]锛寀seOpenSSL[true]
01-Apr-2020 17:21:59.288 淇℃伅 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1c 28 May 2019]
01-Apr-2020 17:21:59.451 淇℃伅 [main] org.apache.coyote.AbstractProtocol.init 鍒濆鍖栧崗璁鐞嗗櫒 ["http-nio-8080"]
01-Apr-2020 17:21:59.468 淇℃伅 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
01-Apr-2020 17:21:59.488 淇℃伅 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 642 ms
01-Apr-2020 17:21:59.528 淇℃伅 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
01-Apr-2020 17:21:59.529 淇℃伅 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51
01-Apr-2020 17:21:59.538 淇℃伅 [main] org.apache.coyote.AbstractProtocol.start 寮濮嬪崗璁鐞嗗彞鏌刐"http-nio-8080"]
01-Apr-2020 17:21:59.552 淇℃伅 [main] org.apache.catalina.startup.Catalina.start Server startup in 63 ms
Connected to server
[2020-04-01 05:21:59,915] Artifact icake:war exploded: Artifact is being deployed, please wait...
01-Apr-2020 17:22:02.115 淇℃伅 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 鑷冲皯鏈変竴涓狫AR琚壂鎻忕敤浜嶵LD浣嗗皻鏈寘鍚玊LD銆 涓烘璁板綍鍣ㄥ惎鐢ㄨ皟璇曟棩蹇楄褰曪紝浠ヨ幏鍙栧凡鎵弿浣嗘湭鍦ㄥ叾涓壘鍒癟LD鐨勫畬鏁碕AR鍒楄〃銆 鍦ㄦ壂鎻忔湡闂磋烦杩囦笉闇瑕佺殑JAR鍙互缂╃煭鍚姩鏃堕棿鍜孞SP缂栬瘧鏃堕棿銆
[2020-04-01 05:22:02,278] Artifact icake:war exploded: Artifact is deployed successfully
[2020-04-01 05:22:02,279] Artifact icake:war exploded: Deploy took 2,363 milliseconds
17:22:02.787 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
17:22:02.823 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
17:22:02.823 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
17:22:02.823 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
17:22:02.823 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
17:22:02.833 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VFS
17:22:02.833 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.JBoss6VFS - JBoss 6 VFS API is not available in this environment.
17:22:02.835 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.VFS - Class not found: org.jboss.vfs.VirtualFile
17:22:02.835 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.VFS - VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
17:22:02.836 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.VFS - Using VFS adapter org.apache.ibatis.io.DefaultVFS
17:22:02.837 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/D:/java/icake/target/icake-1.0-SNAPSHOT/WEB-INF/classes/com/imooc/icake/dao/
17:22:02.837 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/D:/java/icake/target/icake-1.0-SNAPSHOT/WEB-INF/classes/com/imooc/icake/dao/
17:22:02.875 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: CatalogDao.class
17:22:02.875 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Listing file:/D:/java/icake/target/icake-1.0-SNAPSHOT/WEB-INF/classes/com/imooc/icake/dao/
17:22:02.876 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Find JAR URL: file:/D:/java/icake/target/icake-1.0-SNAPSHOT/WEB-INF/classes/com/imooc/icake/dao/CatalogDao.class
17:22:02.876 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Not a JAR: file:/D:/java/icake/target/icake-1.0-SNAPSHOT/WEB-INF/classes/com/imooc/icake/dao/CatalogDao.class
17:22:02.876 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.DefaultVFS - Reader entry: 漱壕 1 , * +
17:22:02.877 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.io.ResolverUtil - Checking to see if class com.imooc.icake.dao.CatalogDao matches criteria [is assignable to Object]
17:22:03.030 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.transaction.jdbc.JdbcTransaction - Opening JDBC Connection
17:22:04.615 [http-nio-8080-exec-1] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 738632859.
17:22:04.620 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Preparing: select * from catalog where id=?
17:22:04.671 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Parameters: 10000(Integer)
17:22:04.718 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Preparing: select * from catalog where pid=?
17:22:04.719 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Parameters: 10000(Integer)
17:22:04.721 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Preparing: select * from catalog where pid=?
17:22:04.722 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Parameters: 11000(Integer)
17:22:04.724 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Preparing: select * from catalog where pid=?
17:22:04.724 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Parameters: 11200(Integer)
17:22:04.726 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Preparing: select * from catalog where pid=?
17:22:04.728 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Parameters: 11201(Integer)
17:22:04.730 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <========== Total: 0
17:22:04.734 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <======== Total: 1
17:22:04.734 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <====== Total: 1
17:22:04.734 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <==== Total: 1
17:22:04.735 [http-nio-8080-exec-1] DEBUG com.imooc.icake.dao.CatalogDao.select - <== Total: 1
17:22:06.292 [http-nio-8080-exec-3] DEBUG org.apache.ibatis.transaction.jdbc.JdbcTransaction - Opening JDBC Connection
17:22:06.337 [http-nio-8080-exec-3] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 1431706439.
17:22:06.337 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Preparing: select * from catalog where id=?
17:22:06.337 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Parameters: 10000(Integer)
17:22:06.342 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Preparing: select * from catalog where pid=?
17:22:06.342 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Parameters: 10000(Integer)
17:22:06.345 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Preparing: select * from catalog where pid=?
17:22:06.348 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Parameters: 11000(Integer)
17:22:06.350 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Preparing: select * from catalog where pid=?
17:22:06.351 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Parameters: 11200(Integer)
17:22:06.353 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Preparing: select * from catalog where pid=?
17:22:06.353 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Parameters: 11201(Integer)
17:22:06.355 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <========== Total: 0
17:22:06.355 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <======== Total: 1
17:22:06.356 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <====== Total: 1
17:22:06.356 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <==== Total: 1
17:22:06.356 [http-nio-8080-exec-3] DEBUG com.imooc.icake.dao.CatalogDao.select - <== Total: 1
01-Apr-2020 17:22:09.541 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 鎶妛eb 搴旂敤绋嬪簭閮ㄧ讲鍒扮洰褰 [D:\apache-tomcat-8.5.51\webapps\manager]
01-Apr-2020 17:22:09.593 淇℃伅 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\apache-tomcat-8.5.51\webapps\manager] has finished in [50] ms
17:22:15.178 [http-nio-8080-exec-6] DEBUG org.apache.ibatis.transaction.jdbc.JdbcTransaction - Opening JDBC Connection
17:22:15.211 [http-nio-8080-exec-6] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 1400651479.
17:22:15.212 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Preparing: select * from catalog where id=?
17:22:15.212 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.select - ==> Parameters: 10000(Integer)
17:22:15.217 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Preparing: select * from catalog where pid=?
17:22:15.217 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ====> Parameters: 10000(Integer)
17:22:15.221 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Preparing: select * from catalog where pid=?
17:22:15.221 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ======> Parameters: 11000(Integer)
17:22:15.224 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Preparing: select * from catalog where pid=?
17:22:15.225 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ========> Parameters: 11200(Integer)
17:22:15.227 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Preparing: select * from catalog where pid=?
17:22:15.227 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - ==========> Parameters: 11201(Integer)
17:22:15.228 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <========== Total: 0
17:22:15.229 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <======== Total: 1
17:22:15.229 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <====== Total: 1
17:22:15.229 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.selectByPid - <==== Total: 1
17:22:15.229 [http-nio-8080-exec-6] DEBUG com.imooc.icake.dao.CatalogDao.select - <== Total: 1
17:22:23.751 [http-nio-8080-exec-10] DEBUG org.apache.ibatis.transaction.jdbc.JdbcTransaction - Opening JDBC Connection
17:22:23.772 [http-nio-8080-exec-10] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 1257997734.
17:22:23.773 [http-nio-8080-exec-10] DEBUG com.imooc.icake.dao.CatalogDao.bathInsert - ==> Preparing: insert into catalog(title,pid,info) values
17:22:23.774 [http-nio-8080-exec-10] DEBUG com.imooc.icake.dao.CatalogDao.bathInsert - ==> Parameters:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.imooc.icake.global.GlobalController.service(GlobalController.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.imooc.icake.global.EncodingFilter.doFilter(EncodingFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
### The error may exist in com/imooc/icake/dao/CatalogDao.java (best guess)
### The error may involve com.imooc.icake.dao.CatalogDao.bathInsert-Inline
### The error occurred while setting parameters
### SQL: insert into catalog(title,pid,info) values
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
at com.sun.proxy.$Proxy17.bathInsert(Unknown Source)
at com.imooc.icake.biz.impl.CatalogBizImpl.add(CatalogBizImpl.java:17)
at com.imooc.icake.controller.CatalogController.add(CatalogController.java:44)
... 30 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
at com.sun.proxy.$Proxy19.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy16.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
... 36 more
package com.imooc.icake.dao;
import com.imooc.icake.entity.Catalog;
import org.apache.ibatis.annotations.*;
import java.util.List;
public interface CatalogDao {
@Insert("<script>" +
"insert into catalog(title,pid,info) values" +
"<foreach collection='list' item='catalog' separator=','>" +
"(#{catalog.title},#{catalog.pid},#{catalog.info})" +
"</foreach>" +
"</script>")
@Options(useGeneratedKeys = true, keyProperty = "id")
void bathInsert(List<Catalog> list);
@Delete("delete from catalog where id = #{id}")
void delete(int id);
@Select("select * from catalog where id=#{id}")
@Results(id = "all",value = {
@Result(column = "id", property = "id", id = true),
@Result(column = "title", property = "title"),
@Result(column = "pid", property = "pid"),
@Result(column = "info", property = "info"),
@Result(column = "id" , property = "children" ,many = @Many(select = "selectByPid"))
})
Catalog select(int id);
@Select("select * from catalog where pid=#{pid}")
@ResultMap("all")
List<Catalog> selectByPid(int pid);
}
正在回答
同学你好!
这是由于外键的约束导致的。由于在删除一级分类时,可能会有二级分类的存在,二级分类依赖于一级分类的id。所以会报错。
如果想解决你可以:
catelog_list.jsp页面中,删除操作的位置处增加一个判断,如果有子分类,则不显示删除操作,如果没有子分类,则显示删除的超链接。
祝:学习愉快~
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`icake`.`cake`, CONSTRAINT `FK_Reference_1` FOREIGN KEY (`cid`) REFERENCES `catalog` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT)
### The error may exist in com/imooc/icake/dao/CatalogDao.java (best guess)
### The error may involve com.imooc.icake.dao.CatalogDao.delete-Inline
### The error occurred while setting parameters
### SQL: delete from catalog where id = ?
### Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`icake`.`cake`, CONSTRAINT `FK_Reference_1` FOREIGN KEY (`cid`) REFERENCES `catalog` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT)
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星