频繁爆出这样的错误: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. js下载文件防止白屏

    思路:用js创建一个iframe,让后指定src为下载目录. var ifup = document.getElementById("xman-activity-export-downLoa ...

  2. 博弈论[leetocde913]

    class Solution { static final int MOUSE_WIN = 1; static final int CAT_WIN = 2; static final int DRAW ...

  3. 简单的IP网络

    企业网络架构:小型.扁平化设计,特点:设备少,网络复杂度低,用路由器加交换或路由器就可以实现. 大中型,分层设计,接入层汇聚层核心层,特点:设备众多,网络组建复杂度高.终端设备较多,偏平化设计不适合. ...

  4. 训练题——DS18B20部分

    Author:Cherry_Ywj 0. 前言 本文档以 DS18B20 为例,主要介绍如何针对一种传感器编写相应的驱动库,驱动是单片机开发中难度较大的一环.从看别人代码并对照 datasheet 开 ...

  5. Java基础|03.基础语法(2)

    Java安全|03.Java基础语法(2) 00x1 单例模式 定义: 单例模式(Singleton Pattern)是 Java 中最简单的设计模式之一.这种类型的设计模式属于创建型模式,它提供了一 ...

  6. Linux模拟手动输入指令

    当执行一个命令,其中会询问你的选择的时候,在脚本上,可以如此模拟手动输入: 运行的命令 <<EOF 键盘输入 EOF 例如挂载硬盘: DISK=/dev/sdb /sbin/fdisk $ ...

  7. CentOS7/6 关闭防火墙(转载)

    CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...

  8. vscode 自用插件

    Auto Rename Tag              自动配对标签,一同更改: 这个还是比较推荐吧,需要修改的时候只用改第一个,闭合的那一头自动跟着修改了. Quokka              ...

  9. DataRow[]数组转换为DataTable

    DataRow[] drData=DataTable.Select("....."); DataTable dtNew=drData.CopyToDataTable(); 注:Da ...

  10. 解决SVN不显示绿色小对勾

    https://blog.csdn.net/qq_34338527/article/details/108534652