报错的大怨种来了--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
频繁爆出这样的错误: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

看了不少资料,一直怀疑是我的字段名不小心用了关键字报错的,检查好多遍,都没有查出来错误来源;
最后还是因为我的一些没注意到的细节对我进行直接拦截;
总结一下的话,就是,报出这种错误主要有两种情况:
1、我们使用的字段名(也就是数据库中的列名,和.java文件里面的变量名称)与关键字重复,需要进行更正,其中,以下这两种关键字最容易引起这种错误:name、group
请各位一定要避免这种错误(有一点小丢人)。
2、就是我这种情况啦!SQL语句书写错误,在这里给大家醍醐灌顶以下:
//查询语句
String sql1="select * from 表名 where 条件";
//添加语句
String sql2="insert into 表名 values(各个字段)";
//修改语句
String sql3="update 表名 set 修改后的数据 where 定位到某一列";
//删除语句
String sql4="delete from 表名 where 删除条件";
别像我似的漏掉啥东西了啊!
报错的大怨种来了--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的更多相关文章
- ERROR: 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 'type=InnoDB' at line 7
问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...
- 1064 - 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 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1
mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...
- 插入mysql语句报错:1064 - 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
插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...
- 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 'like '%逸%'' at line 1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-/ ...
- mybatis批量更新update-设置多个字段值 报错 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
mybatis批量更新update-设置多个字段值 2016年08月01日 12:49:26 姚一号 阅读数:29539 标签: mysql mybatis批量更新批量更新allowMultiQuer ...
- 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
myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL se ...
- 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 'group t1,customer t2
### SQL: select t1.gid,t1.gname,t1.gvalue,t1.gtype, t1.gaddress,t1.gmembers, t1.gcode,t1.gphone, t2. ...
- [Err] 1064 - 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 ''<h1 style="text-align: center;">php
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...
- MySql 执行语句错误 Err] 1064 - 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
关于用Power Designer 生成sql文件出现 错误 [Err] 1064 - You have an error in your SQL syntax; check the manual ...
- 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 ...
下面是我update数据库时打印出来的异常: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSynt ...
随机推荐
- Linux 库的使用
Linux 库的使用 -I头文件的路径-L动态库的路径 命名 使用 静态库 lib名字.a 静态库路径/lib名字.a 动态库 lib名字.so -L动态库路径 -l名字 编译 #静态编译 # g ...
- css如何实现(animation)跑马灯效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- SQL-运算
dual表可以进行运算select * from dual; 算数运算 + - * /select 5 + 6 as aaa ,6 - 3 as bbb ,5 * 7 as ccc ,9/2 as d ...
- Http 包头里面有个content-length,可以获取下载的资源包大小
NSDictionary *headerFieldsDic = request.responseHeaders; 包大小为:[headerFieldsDic[@"Content-Length ...
- Mixly呼吸灯及可调灯(物联网)
3挡可调灯 2秒呼吸灯
- 免费Linux RDP,用来练习linux或者Python,还能做成远程桌面
分类:资源| 阅读:1103次阅读 goorm提供了免费的Linux容器,用它来在线练习命令行是非常不错的. 它的注册非常简单:https://ide.goorm.io/ 直接用谷歌账号登录即 ...
- transition实现元素动画平移
效果: 将灰色背景区域移除屏幕,并实现动画效果 代码: 使用transition属性可定义平移的时间,巧用calc得出非确定高度元素的平移距离
- mysql_记录操作
在MySQL管理软件中,可以通过SQL语句中的DML语言来实现数据的操作,包括 使用INSERT实现数据的插入 UPDATE实现数据的更新 使用DELETE实现数据的删除 使用SELECT查询数据以及 ...
- C语言初级阶段7——指针2——特殊指针
C语言初级阶段7--指针2--特殊指针 指针函数:是一个函数,返回值类型是一个指针. #include<stdio.h> int* fun() { //a是一个局部变量 int a = 1 ...
- MacOS使用iTerm2 tab不区分大小写解答
打开控制台 输入 vim ~/.zshrc 按下 i 之后 // i == insert插入字符 粘贴以下代码 复制到该文件中 autoload -Uz compinit && co ...