报错的大怨种来了--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 ...
随机推荐
- javaScript面向对象(继承篇)
一.构造函数继承 function Parent() { this.money = '2亿' this.eat = function () { console.log('吃饭') } } func ...
- iOS开发之UIImage压缩处理
IOS中UIImage的数据量压缩有两种方式,一种是图片尺寸不变,降低图片分辨率,代码方法为: //1.0为压缩系数,介于0~1之间.压缩系数越小,会大大降低图片清晰度 NSData *data = ...
- promethus+grafana监控
1.监控 MySQL (终端可以安装在任意主机,不一定按在mysql节点上,注:mysql版本需在5.5以上) I.首先在mysql中添加监控使用的用户: create user 'exp'@'%' ...
- 第九章 MySQL 高可用(MHA)
MySQL 高可用(MHA) 一 MHA高可用部署 需要使用的前提: 当普通主从复制不能满足我们的需求, 主节点宕机 影响业务的不间断运行.这里就需要用到MHA 高可用 1. MHA高可用的介绍 ...
- python 处理CAD文件
注意:如下的两个脚本都是我自己亲自试过的,可以运行得到结果!可以直接运行!可以直接运行! 网上的中文api能找到的不够全,工作中有用到部分功能,自己从中文英文资料里面找到一些,这里做一些总结. 画图a ...
- docker从C盘迁移到D盘
docker镜像在C盘占据大量的空间,将.docker从C:\Users\Administrator迁移到E:\.docker. 一.关闭virtual Box 使virtual Box处于关闭.停止 ...
- Coursera Programming Languages, Part B 华盛顿大学 Week 1
来上 programming language 的第二 part 了!这一部分介绍的语言是 Racket,之前就听说过它独特的括号语法,这次来具体了解一下 Racket definitions, fu ...
- 使用Wireshark完成实验1
用来观察协议执行实体之间交换的报文的基本工具被称为分组嗅探器(packet sniffer),一个分组嗅探器被动地拷贝(嗅探)计算机发送和接受的报文,也能显示出这些被捕获报文的各个协议字段的内容.Wi ...
- 记录一次 网关负载 流量不均匀 cpu使用率不均衡问题
网关负载 流量不均匀 cpu使用率不均衡问题??? 1.压力机访问源 有多少ip 有10个? 还是20个? 就是样本源不多的话,负载上hash的话 就你可能不是真实的访问需求 ,你客户端就那么 ...
- deepin 调整微信、百度网盘、迅雷等等软件字体的方法
一.修改微信字体大小方法: 1.方法一:修改deepinwine桌面环境字体 env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" wi ...