`

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException解决

阅读更多

 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'last_login_time' in 'field list'

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_101]

at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_101]

at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.Util.getInstance(Util.java:387) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192) ~[mysql-connector-java-5.1.39.jar:5.1.39]

at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3051) ~[druid-1.1.1.jar:1.1.1]

at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440) ~[druid-1.1.1.jar:1.1.1]

at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3049) ~[druid-1.1.1.jar:1.1.1]

at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:168) ~[druid-1.1.1.jar:1.1.1]

at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:494) ~[druid-1.1.1.jar:1.1.1]

at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.4.4.jar:3.4.4]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.4.jar:3.4.4]

at com.sun.proxy.$Proxy115.query(Unknown Source) ~[?:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]

at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49) ~[mybatis-3.4.4.jar:3.4.4]

at com.baomidou.mybatisplus.plugins.PerformanceInterceptor.intercept(PerformanceInterceptor.java:123) ~[mybatis-plus-2.1-gamma.jar:?]

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.4.4.jar:3.4.4]

at com.sun.proxy.$Proxy115.query(Unknown Source) ~[?:?]

at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) ~[mybatis-3.4.4.jar:3.4.4]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.4.jar:3.4.4]

at com.sun.proxy.$Proxy114.query(Unknown Source) ~[?:?]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) ~[mybatis-3.4.4.jar:3.4.4]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.1.jar:1.3.1]

at com.sun.proxy.$Proxy52.selectOne(Unknown Source) ~[?:?]

at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) ~[mybatis-spring-1.3.1.jar:1.3.1]

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) ~[mybatis-3.4.4.jar:3.4.4]

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.4.jar:3.4.4]

at com.sun.proxy.$Proxy56.selectById(Unknown Source) ~[?:?]

at com.ds.core.base.BaseService.queryById(BaseService.java:350) ~[classes/:?]

at com.ds.core.base.BaseService.queryById(BaseService.java:334) ~[classes/:?]

at com.ds.core.base.BaseService$$FastClassBySpringCGLIB$$2177fd04.invoke(<generated>) ~[classes/:?]

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:646) ~[spring-aop-5.0.0.M5.jar:5.0.0.M5]

at com.ds.service.UserService$$EnhancerBySpringCGLIB$$cda8cc9e.queryById(<generated>) ~[classes/:?]

at com.ds.controller.view.BlogView.blog(BlogView.java:41) ~[classes/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:826) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:964) ~[spring-webmvc-5.0.0.M5.jar:5.0.0.M5]

... 58 more

 

使用mybatis执行某条语句时报错,内容如上。

 

原因:

数据库改了一个字段,导致原来的SQL不能用了

此异常为SQL错误,把SQL拷贝到数据库中执行,即可找到错误!

分享到:
评论

相关推荐

    Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ….. this is incompatible with sq

    1、写在开头 标题之前我想说一下Linux的mysql真的实在是太坑了。太坑了。总是会出现这样那样的你想不到的问题。崩溃了。首先来罗列一下我遇到过的...Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorExcepti

    bitronix 连接 MySQL 出现MySQLSyntaxErrorException 的解决方法

    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'hibernate' at sun.reflect.NativeConstructorAccessorImpl.new

    mysql-connector-java-5.1.12.rar 源代码

    MySQL Connector/J 5.1.12 是 MySQL 官方提供的用于 Java 应用程序...3. com.mysql.jdbc.exceptions 包:包含所有由 MySQL Connector/J 抛出的异常类,如 `com.mysql.jdbc.exceptions.MySQLSyntaxErrorException` 和 `...

    mysql的jar

    5. **异常处理**:当数据库操作遇到问题时,会抛出特定的异常,如`com.mysql.jdbc.exceptions.MySQLSyntaxErrorException`和`com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException`等。...

    解决mysql导入新数据库大小写问题(Table ‘zup.Domain_System’ doesn’t exist)

    问题 Table ‘zup.Domain_System’ doesn’t exist ...### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'zup.Domain_System' doesn't exist ; bad SQL grammar []; nested

    mysql_jdbc连接数据库-错误提示.pdf

    Exception in thread "main" com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown database 'hrtrain' ``` **解决方法**: - 确认数据库名称是否正确。 - 检查MySQL服务状态,确保其正在运行。 #### 五...

    mysql-connector-java-6.0.6源码

    `com.mysql.jdbc.exceptions`包包含了所有可能抛出的MySQL特定异常,如`MySQLSyntaxErrorException`、`MySQLIntegrityConstraintViolationException`等,这些异常在遇到错误时被抛出,帮助开发者识别和解决问题。...

    mysql-connector-java-5.1.33-bin.src源码

    6. **异常处理**: 源码中包含了大量的异常类,如`com.mysql.jdbc.exceptions.MySQLSyntaxErrorException`,这些异常类对应于MySQL数据库的各种错误情况,帮助开发者诊断和解决问题。 7. **性能优化**: MySQL ...

    mysql-connector-java-5.1.13-bin.jar

    3. `com.mysql.jdbc.exceptions`包:包含了MySQL特有的异常类,如`MySQLSyntaxErrorException`、`MySQLIntegrityConstraintViolationException`等,这些异常帮助开发者识别和处理数据库操作中的错误。 使用这个驱动...

    mysql-connector-java-5.1.48 (1).jar

    5. `com.mysql.jdbc.exceptions`: MySQL特有的异常类,如`MySQLSyntaxErrorException`、`MySQLIntegrityConstraintViolationException`等,这些异常在处理数据库操作时可能会被抛出。 使用这个驱动,开发者可以创建...

    jeecms2012sp1支持高版本mysql数据库补丁

    jeecms2012sp1支持高版本mysql数据库补丁 ...com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'table_names' in information_schema 使用方法:压缩包解压,将文件拷贝到对应的目录即可

    mysql-connector-java-3.1.7.zip

    8. **异常处理**:使用`com.mysql.jdbc.exceptions`包中的异常类,如`MySQLSyntaxErrorException`,`MySQLIntegrityConstraintViolationException`等,提供详细的错误信息。 9. **性能优化**:包括预编译的SQL语句...

    mysql-connector-java-5.0.8-bin.jar

    2. `com.mysql.jdbc.exceptions`包:这里包含了所有可能抛出的异常类,如`MySQLSyntaxErrorException`、`MySQLTransactionRollbackException`等,这些异常对应于在与MySQL交互时可能出现的问题。 3. `...

    JSP向MYSQL插入单引号内容出错的解决方法.pdf

    java.servlet.ServletException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right ...

    mysql授权管理1

    首先,我们从给定的描述中可以看到一个常见的错误提示:“Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'root'@'%' to database 'bcsap'”。这个异常表明,用户'...

    JavaFX程序初次运行创建数据库并执行建表SQL详解

    if (e instanceof MySQLSyntaxErrorException) { // 注意:这可能是过时的,应使用com.mysql.cj.jdbc.exceptions.MySQLSyntaxErrorException primaryStage.setTitle("正在创建Utility数据库……"); Label error =...

    mysql-connector-java-5.1.36-bin

    9. **异常处理**:定义了 `com.mysql.jdbc.exceptions` 包下的异常类,如 `MySQLSyntaxErrorException` 和 `MySQLTimeoutException`,便于处理错误和异常情况。 在实际应用中,你需要在项目的构建配置文件(如 ...

    Java常见异常

    3. **com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '[数据库表标识符].[列名]' in 'field list'** 这个错误表示在执行SQL查询时,尝试访问不存在的数据库列。检查数据库结构和...

    解决MySQL 5.7.9版本sql_mode=only_full_group_by问题

    com.MySQL.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘col_user_6.a.START_TIME’ which is not ...

    乐优商城.xmind

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'idASC' in 'order clause' 错误:(desc ? "DESC" : "ASC"); 正确:(desc ? " DESC" : " ASC"); 字符串空格问题 新增 Controller...

Global site tag (gtag.js) - Google Analytics