如果您想了解myBatis查询报错YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQ...的相关知识,那么本文是
如果您想了解myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQ...的相关知识,那么本文是一篇不可错过的文章,我们将为您提供关于Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual tha、check the manual that corresponds to your MySQL server version for the right syntax to use near、check the manual that corresponds to your MySQL server version for the right syntax to use near ''lim、check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax的有价值的信息。
本文目录一览:- myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQ...
- Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual tha
- check the manual that corresponds to your MySQL server version for the right syntax to use near
- check the manual that corresponds to your MySQL server version for the right syntax to use near ''lim
- check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax
myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQ...
myBatis查询报错
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
<select id="selectList" parameterType="com.hanilucky.core.vo.Dep"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dep
<where>
<if test="uuid != null">
AND UUID = #{uuid,jdbcType=INTEGER}
</if>
<if test="name != null and name != ''''">
AND NAME = #{name,jdbcType=VARCHAR}
</if>
<if test="tele != null and tele != ''''">
AND TELE = #{tele,jdbcType=VARCHAR}
</if>
</where>
</select>
标红的NAME是mysql的关键字,解析时报错
修改时加上``引用(数字1左边的键)
<select id="selectList" parameterType="com.hanilucky.core.vo.Dep"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dep
<where>
<if test="uuid != null">
AND UUID = #{uuid,jdbcType=INTEGER}
</if>
<if test="name != null and name != ''''">
AND `NAME` = #{name,jdbcType=VARCHAR}
</if>
<if test="tele != null and tele != ''''">
AND TELE = #{tele,jdbcType=VARCHAR}
</if>
</where>
</select>
Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual tha
使用了数据库的关键字index,如果有类似的错误,看看自己有没有使用关键字!
check the manual that corresponds to your MySQL server version for the right syntax to use near
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 ''(97168,26195,661,4.708181029,''prefer''),(97168,26195,740,7.4143620581,''prefer''),('' at line 1
at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
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:943)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
check the manual that corresponds to your MySQL server version for the right syntax to use near ''lim
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 ''limit 1, 6'' at line 1 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.lang.reflect.Constructor.newInstance(Constructor.java:423) com.mysql.jdbc.Util.handleNewInstance(Util.java:406) com.mysql.jdbc.Util.getInstance(Util.java:381)
sql写的有问题,在sql结尾多写了一个“;”,建议遇到类似问题,先仔细检查一下sql 的正确性;
check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax
check the manual that corresponds to your mysql server version for the right syntax的错误解析,correspondssyntax
错误原因一:SQL关键字冲突
分析:例:把desc命名为字段名
错误原因二:$right=$DB->fetch_one_array("SELECT rsnumber FROM ".$db_prefix."userright WHERE usertitle=".$usertitle"");
分析:.$usertitle.应该是这样的表示方式与数据库中的字段发生冲突,改成上图中的代码就可以了
(备注:个人拙见,希望有人补充!)
今天关于myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQ...的分享就到这里,希望大家有所收获,若想了解更多关于Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual tha、check the manual that corresponds to your MySQL server version for the right syntax to use near、check the manual that corresponds to your MySQL server version for the right syntax to use near ''lim、check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax等相关知识,可以在本站进行查询。
本文标签: