频繁爆出这样的错误: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的更多相关文章

  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 ...

  2. 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', ...

  3. 插入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 ...

  4. 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 "-/ ...

  5. 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 ...

  6. 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 ...

  7. 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. ...

  8. [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 ''&lt;h1 style=&quot;text-align: center;&quot;&gt;php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. fio - IO测试工具

    目前主流的第三方IO测试工具有fio.iometer和Orion,这三种工具各有千秋. fio在Linux系统下使用比较方便,iometer在window系统下使用比较方便,Orion是oracle的 ...

  2. Miller-Rabin素性判定算法

    Miller-Rabin素性判定算法是一种基于概率的判定算法,每次判定n是素数的正确性概率至少为75%,出错的概率小于25%. 如果对n进行k次素性检测,如果结果n为素数,那么n为合数的概率为1/(4 ...

  3. DataTable TO List<T>

    datatable转list<> public IList<T> GetList<T>(DataTable table){IList<T> list = ...

  4. List一边插入数据后又移除数据

    记录最简单的三种方法,直接上代码: List<String> list = new ArrayList<>(); list.add("1"); list.a ...

  5. 上传路径Class替换无效

    路径配置文件使用的常量,其它文件使用路径时,编译class时为静态常量信息,改变不同的路径常量则不生效

  6. 【摘】python和它的super

    python和它的super 如果用过python2,你一定见过下面这个奇怪的代码 class Mama(object): def says(self): print('i am mama') cla ...

  7. Python 使用json存储数据

    一.前言 很多程序都要求用户输入某种信息,如让用户存储游戏首选项或提供要可视化的数据.不管专注的是什么,程序都把用户提供的信息存储在列表和字典等数据结构中.用户关闭程序时,你几乎总是要保存他们提供的信 ...

  8. Jmeter-接口测试(二)

    鉴权码获取: 1.通过接口获取 appid secret  (第三方用户唯一凭证, 第三方用户唯一凭证秘钥) 2.登录之后自动生成 username,password 一.jmeter 接口关联 1. ...

  9. 第17章 使用日志记录监视和排除错误(ASP.NET Core in Action, 2nd Edition)

    第3部分 扩展应用程序 我们在第1部分和第2部分中介绍了大量内容:我们查看了您将用于构建传统服务器渲染的 Razor Pages 应用程序以及 Web API 的所有主要功能组件.在第3部分中,我们将 ...

  10. mybatis插入批量数据

    1 for循环重复调用dao,消耗大   2 sql语句编写插入多条,只用于少数   3 mybatis的batch插入   @Test public void testInsertBatch2() ...