mybatis报错,navicat没问题

在执行Mybatis查询时遇到SQL语法错误,提示信息指出问题在于SQL语句中的大于号'>'. 经检查发现,在<select>标签内的SQL语句后面意外多了一个'>'. 删除这个多余的字符后,问题得到解决。
摘要由CSDN通过智能技术生成

错误信息:

==>  Preparing: > select id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp_spsj from tb_yw_ztry where 1=1 
==> Parameters: 
Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@654c687d]
2019-05-31 11:27:16.818 ERROR 9460 --- [nio-9401-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
    select 
     
    id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp' at line 1
### The error may exist in file [E:\eclipse-workspace\clue-parent\clue-dao\clue-dao-ztry\target\classes\cn\id5\mapper\ztry\sqlmap\ZtryMapper.xml]
### The error may involve cn.id5.mapper.ztry.ZtryMapper.queryZtryPageList-Inline
### The error occurred while setting parameters
### SQL: >     select            id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp_spsj          from tb_yw_ztry     where 1=1
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
    select 
     
    id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp' at line 1
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
    select 
     
    id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp' at line 1] with root cause

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>
    select 
     
    id, ztrybh, xm, zjhm, xxdjdw_gajgmc,xxdjdw_gajgjgdm,djsp' at line 1
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:387) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值