报错的大怨种来了--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 ...
随机推荐
- 5G智慧灯杆系统在智慧街区的应用
智慧化的路灯作为一个高度集成的项目,是智慧城市在城市公共空间的落地载体,是一个自上而下的体系,有外延.可扩展.能适配智慧城市的建设要求.在商业街开展智慧灯杆建设,同期开展5G应用技术试点,有利于商业街 ...
- Linux python后台任务
Ubuntu 后台持续运行python服务 一般使用 nohup python -u app.py>t.log 2>&1 & nohup python3 -u app.py ...
- 操作系统|03.Linux基础(2)
Linux基础(二) 3.vim编辑器 命令模式:控制光标移动,对文本进行删除.复制.粘贴等工作.编辑模式:正常的文本录入.末行模式:保存.退出和设置编辑环境. 3.1命令模式常用命令 -r:恢复系统 ...
- Navicat Premium 12 安装破解过程 (经过测试)
@ 目录 下载安装 下载 解压文件目录 安装使用步骤截图 1. 安装navicat120_premium_cs_x64.exe 软件 2. 解压Navicat.Premium 破解补丁.rar 3. ...
- 从零开始:在树莓派上安装OpenEuler
树莓派(Raspberry Pi)是一款基于ARM架构的小型电脑,它的便携性和低功耗性能使它成为制作物联网设备或运行嵌入式系统的理想选择.在这篇博客中,我们将介绍如何在树莓派上安装OpenEuler操 ...
- vue项目中 vscode 保存时自动格式化设置,保持单引号和去除多余分号、逗号
1.settings.json中添加: "prettier.semi": false, // 取消自动加分号 "prettier.singleQuote": t ...
- 【Win11】电脑开机内存占用过高
联想拯救者 Y7000P 1.Win+R打开运行输入"MdSched" 重启 2.Windows PowerShell(管理员)->并运行该命令 Disable-MMAg ...
- sql创建表时候单引号不是单引号是,而是Esc下面的按键
CREATE TABLE `test`.`testmd5` ( `id` INT ( 4 ) NOT NULL, `name` VARCHAR ( 20 ) NOT NULL, `pwd` VARCH ...
- C++ Primer 15.9文本查找程序
可以通过查询语句的组合进行检索,VS2015. main函数,读取存有数据的文件,进行检索.提供两种入口.查词,与按照表达式查询. 1 #include <iostream> 2 #inc ...
- JVM调优学习笔记
TODO:需要学习的命令 jps jstat -gcutil pid xxxx jmap histo:live pid