一次 Mysql 字符集的报错,最后让我万马奔腾!!!
wuba---深圳---龙岗周边----3000元---------
wuba---深圳---龙岗周边----5000元---------
wuba---深圳---龙岗周边----8000元---------
wuba---深圳---龙岗周边----1000元---------
wuba---深圳---龙岗周边---600元以下---------
wuba---深圳---龙岗周边---8000元以上---------
Mon Jan :: CST 2018Insert Danke check data inserted
java.sql.BatchUpdateException: 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 'range,num) values('','wuba','深圳','龙岗周边','8000元以上',36)' at line
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:)
at util.InsertIntoMysql.InsertDankeCheck(InsertIntoMysql.java:)
at Info.Xx_Danke.Xx_DankeRank(Xx_Danke.java:)
at Info.Xx_Danke.main(Xx_Danke.java:)
Caused by: com.mysql.jdbc.exceptions.jdbc4.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 'range,num) values('','wuba','深圳','龙岗周边','8000元以上',36)' at line
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.Util.getInstance(Util.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:)
... more
开始以为是字符集的错误,各种找原因,看JDBC连接参数。。。
试了N种方法之后,直接用代码传入定值,结果依旧。当时马上就知道了,表出问题了。。。
复制了一个可以用的表,然后改结构,重试。依然报这个错。
再复制insert语句到navicat中,结果还是报错。。。 目标定到了我的‘’range‘’字段
insert into danke_check(day,site,city,street,range,num) values ('2017-10-20','anjuke','深圳','龙门县','500-8000元',20)
insert into danke_check(day,site,city,street,range_num,num) values ('2017-10-20','anjuke','深圳','龙门县','500-8000元',20)
当时range字段是蓝色字体,好像心里就明白了。
把range改成range_num 插入完成。
顿时,万马奔腾!!!!!!!!!!!!!!!不是第一次了,也差不多是第二次了,range是关键词!!!!!
2018年1月23日10:14:13
记录一下
一次 Mysql 字符集的报错,最后让我万马奔腾!!!的更多相关文章
- CentOS命令登录MySQL时,报错ERROR 1045 (28000):
CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解 ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause
Mysql update in报错 解决方案: [Err] 1093 - You can't specify target table 'company_info' for update in FRO ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- MySQL主从1205报错【转】
主从报错1205 Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the va ...
- 远程登陆linux连接mysql root账号报错:2003-can't connect to MYSQL serve(转)
远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...
- 远程连接mysql root账号报错:2003-can't connect to MYSQL serve(转)
远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...
- MySQL数据源驱动报错
报错信息:MySQL数据源驱动报错: 1.mysql8.0以上版本需要连接数据库的JDBC驱动也是8.0版本以上 com.mysql.cj.jdbc.Driver 2.MySQL高版本需要指明是否需要 ...
- Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "
前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...
随机推荐
- 获取整个页面HTML的信息以及注意事项
两种方式: 1.从每个节点获取 var a = '<!DOCTYPE html><html lang="zh-cn">'; var z = "&l ...
- LeetCode OJ:Best Time to Buy and Sell Stock II(股票买入卖出最佳实际II)
Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...
- UI-自定义TabBar
MyCustomTabBar.h文件 #import <UIKit/UIKit.h> @interface MyCustomTabBar : UITabBarController @end ...
- react: next-redux-saga
instead of using the Provider component, you can use the withRedux higher order component to inject ...
- php实现安装程序的 安装
install.php 只要填写数据库就可以把数据插入到数据库中,实现安装 <?php header("Content-type:text/html;charset=utf-8&quo ...
- POJ 2029 Palindromes _easy version
#include<cstdio> #include<cstring> using namespace std; int main() { int n; ]; scanf(&qu ...
- NIO:异步非阻塞I/O,AIO,BIO
Neety的基础使用及说明 https://www.cnblogs.com/rrong/p/9712847.html BIO(缺乏弹性伸缩能力,并发量小,容易出现内存溢出,出现宕机 每一个客户端对应一 ...
- 【BZOJ2908】又是nand 树链剖分+线段树
[BZOJ2908]又是nand escription 首先知道A nand B=not(A and B) (运算操作限制了数位位数为K)比如2 nand 3,K=3,则2 nand 3=not (2 ...
- 对Servlet规范的蜻蜓点水
现在我们大家基本都用struts或springmvc进行java web的开发,但我们都知道java web的核心技术是jsp servlet javabean的组合.因此很有必要知道servlet规 ...
- TortoiseGit不同分支合并代码2
现在有主分支master和分支day2.现在要把day2上的变更合并到主分支master上! 1.首先切换到目标分支master上. 说明当前分支是master分支. 2.在master分支上查看提交 ...