mybatis之insert语句报错Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. token : WHERE,

报错日志:org.springframework.jdbc.UncategorizedSQLException: 
Error updating database. Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. token : WHERE, pos : 315 : UPDATE jxdx_leave

报错原因:多了一个逗号; 
关键看token后面,这里通过token可以直接定位报错地点;

原文地址:https://www.cnblogs.com/cailijuan/p/9360519.html

时间: 2024-07-30 07:24:05

mybatis之insert语句报错Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. token : WHERE,的相关文章

mybatis配置,idea报错:java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/mybatis_test

报错信息: "C:\Program Files\Java\jdk1.8.0_211\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.4\lib\idea_rt.jar=54826:C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.4\bin" -Dfile.encoding=UTF-8 -classpath "C

MyBatis处理一行数据-MyBatis使用sum语句报错-MyBatis字段映射-遁地龙卷风

(-1)写在前面 我用的是MyBatis 3.2.4 (0) 编程轶事 select sum(value) ,sum(value2)  from integral_list where  MemberId = #{0} and operate = 1 and  Year(AddTime) = #{1} and ChannelType = #{2} and ChannelCode = #{3} 我用的sqlyoug显示的的字段名分别是sum(value) .sum(value2) 我在xml文件中

MySQL分段统计SQL写法 与 Mybatis 报错:java.math.BigDecimal cannot be cast to java.lang.Integer

mysql> select -> sum(case when score<60 then 1 else 0 end) as '<60', -> sum(case when score>=60 and score<=69 then 1 else 0 end) as '60~69', -> sum(case when score>=70 and score<=79 then 1 else 0 end) as '70~79', -> sum(ca

spring 切面织入报错:java.lang.ClassCastException: com.sun.proxy.$Proxy7 cannot be cast to...

报这个错,只有一个原因,就是转化的类型不对. 接口过父类的子类,在强制转换的时候,一定要用接口父类来定义. 代码示例: package com.luoluo.dao.impl; import java.sql.Connection; import java.sql.SQLException; import javax.annotation.Resource; import javax.sql.DataSource; import com.luoluo.dao.UserDAO; import co

SQL Server中事务transaction如果没写在try catch中,就算中间语句报错还是会提交

假如我们数据库中有两张表Person和Book Person表: CREATE TABLE [dbo].[Person]( [ID] [int] IDENTITY(1,1) NOT NULL, [Code] [nvarchar](50) NULL, [Name] [nvarchar](50) NULL, [CreateTime] [datetime] NULL, [UpdateTime] [datetime] NULL, CONSTRAINT [PK_Person] PRIMARY KEY CL

mysql插入报错:java.sql.SQLException: Incorrect string value: &#39;\xE6\x9D\xAD\xE5\xB7\x9E...&#39; for column &#39;address&#39; at row 1

界面报错: 日志报错: java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row 1 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.17.jar:8.0.17] at com.mys

Android开发时,sqlite创建表成功,insert不报错,但没有数据插入的原因

在android开发过程中,经常要通过sqlite来存储一些数据,这种应用应该是再平常不过了,但是有时难免一时疏忽,就会出现sqlite创建表成功,insert不报错,但没有数据插入. 具体问题详见如下代码: Context ctx;        SQLiteDatabase db = dbOpenHelper.getWritableDatabase(); // 开启事务        db.beginTransaction();        try{                // 数

对象逆序列化报错:java.lang.ClassNotFoundException

简单的想从保存的对象中又一次解析出对象.用了逆序列化,但是报错: java.lang.ClassNotFoundException: xxxxxxxxxxxx at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native

报错: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

描述:使用Hibernate登陆验证时故意输入没有的用户名,所产生的错误. 错误代码: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /*      * 根据客户的用户名查找客户信息      */     @Override     public User getUserByUserName(String userName) {         String hql="from User where userName=?";         Session s