报错的大怨种来了--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 ...
随机推荐
- 049_Search Lookup (二)
其实就是 在父object中 设置,search setting 中选中 enhanced lookup, and select the dialoge & Filter 默认looukp搜 ...
- python菜鸟学习: 6. 字典常用方法
# -*- coding: utf-8 -*-dict1 = {"name": "liyuzhoupan", "age": "22 ...
- 第一次写代码(Hellowold)
Helloword 新建一个code文件夹,存放代码 新建一个hava文件 文件后缀名为java 编写代码 java 1. public class Hello{ public static ...
- linux清除日志和文件缓存
1.查找大文件,从根目录 find / -type f -size +800M 2.查看磁盘挂载情况及挂载目录 df -lh 3.查看内存使用情况 free -m 4.清除缓存 echo 3 > ...
- js之对象处理
数据拼接一: 原始数据为对象 { 0grade: "" 0home: "萍钢四切(边部钩痕)" 0price: "3200" 0produc ...
- Python 错误:TypeError: range() takes no keyword arguments
问题描述: for循环时使用range()出错: for page in range(start=1, stop=8 + 1,step=1): print(page) 结果报错TypeError: r ...
- spring boot 中 CommandLineRunner接口使用
接口定义:接口,用于指示bean包含在SpringApplication中时应运行.可以在同一应用程序上下文中定义多个CommandLineRunner bean,并可以使用ordered接口或@Or ...
- web之jquery
jquery 插件 下载解压插件 加载jQuery 加载插件 插件样式 按照使用例子给元素添加类名,id,函数.
- 【Unity】阅读LuaFramework_UGUI的一种方法
写在前面 我第一次接触到LuaFramework_UGUI是在一个工作项目中,当时也是第一次知道toLua.但我刚开始了解LuaFramework_UGUI时十分混乱,甚至将LuaFramework_ ...
- 【原创】freetype android交叉编译
项目中Opencv需要显示中文,由于本身并不支持,所以需要借助第三方的库freetype来实现.这个库虽然android本身也有使用,但并没有暴露接口给外部使用. freetype官网 方式1 脚本编 ...