代码如下:
pstmt = conn.prepareStatement("insert into column(columnTitle) values(?)");
pstmt.setString(1, column.getColumnTitle());
执行这个插入语句的时候,出现以下错误信息:
引用
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 'column(columnTitle) values('?¨±????…????')' at line 1
一直把问题定位为插入语句的语法有问题,查找的时候也是往这个方向查,以至于对于网上说的”关键字引用错误”之类的解决方法直接无视,
后来终于看到有个同学跟我用了同样一个关键字“column”作为表名,问题解决,呃~为了防止再犯这样的错误,贴上mysql关键字列表:
ADD | ALL | ALTER |
ANALYZE | AND | AS |
ASC | ASENSITIVE | BEFORE |
BETWEEN | BIGINT | BINARY |
BLOB | BOTH | BY |
CALL | CASCADE | CASE |
CHANGE | CHAR | CHARACTER |
CHECK | COLLATE | COLUMN |
CONDITION | CONNECTION | CONSTRAINT |
CONTINUE | CONVERT | CREATE |
CROSS | CURRENT_DATE | CURRENT_TIME |
CURRENT_TIMESTAMP | CURRENT_USER | CURSOR |
DATABASE | DATABASES | DAY_HOUR |
DAY_MICROSECOND | DAY_MINUTE | DAY_SECOND |
DEC | DECIMAL | DECLARE |
DEFAULT | DELAYED | DELETE |
DESC | DESCRIBE | DETERMINISTIC |
DISTINCT | DISTINCTROW | DIV |
DOUBLE | DROP | DUAL |
EACH | ELSE | ELSEIF |
ENCLOSED | ESCAPED | EXISTS |
EXIT | EXPLAIN | FALSE |
FETCH | FLOAT | FLOAT4 |
FLOAT8 | FOR | FORCE |
FOREIGN | FROM | FULLTEXT |
GOTO | GRANT | GROUP |
HAVING | HIGH_PRIORITY | HOUR_MICROSECOND |
HOUR_MINUTE | HOUR_SECOND | IF |
IGNORE | IN | INDEX |
INFILE | INNER | INOUT |
INSENSITIVE | INSERT | INT |
INT1 | INT2 | INT3 |
INT4 | INT8 | INTEGER |
INTERVAL | INTO | IS |
ITERATE | JOIN | KEY |
KEYS | KILL | LABEL |
LEADING | LEAVE | LEFT |
LIKE | LIMIT | LINEAR |
LINES | LOAD | LOCALTIME |
LOCALTIMESTAMP | LOCK | LONG |
LONGBLOB | LONGTEXT | LOOP |
LOW_PRIORITY | MATCH | MEDIUMBLOB |
MEDIUMINT | MEDIUMTEXT | MIDDLEINT |
MINUTE_MICROSECOND | MINUTE_SECOND | MOD |
MODIFIES | NATURAL | NOT |
NO_WRITE_TO_BINLOG | NULL | NUMERIC |
ON | OPTIMIZE | OPTION |
OPTIONALLY | OR | ORDER |
OUT | OUTER | OUTFILE |
PRECISION | PRIMARY | PROCEDURE |
PURGE | RAID0 | RANGE |
READ | READS | REAL |
REFERENCES | REGEXP | RELEASE |
RENAME | REPEAT | REPLACE |
REQUIRE | RESTRICT | RETURN |
REVOKE | RIGHT | RLIKE |
SCHEMA | SCHEMAS | SECOND_MICROSECOND |
SELECT | SENSITIVE | SEPARATOR |
SET | SHOW | SMALLINT |
SPATIAL | SPECIFIC | SQL |
SQLEXCEPTION | SQLSTATE | SQLWARNING |
SQL_BIG_RESULT | SQL_CALC_FOUND_ROWS | SQL_SMALL_RESULT |
SSL | STARTING | STRAIGHT_JOIN |
TABLE | TERMINATED | THEN |
TINYBLOB | TINYINT | TINYTEXT |
TO | TRAILING | TRIGGER |
TRUE | UNDO | UNION |
UNIQUE | UNLOCK | UNSIGNED |
UPDATE | USAGE | USE |
USING | UTC_DATE | UTC_TIME |
UTC_TIMESTAMP | VALUES | VARBINARY |
VARCHAR | VARCHARACTER | VARYING |
WHEN | WHERE | WHILE |
WITH | WRITE | X509 |
XOR | YEAR_MONTH | ZEROFILL |
分享到:
相关推荐
check the manual that corresponds to your MySQL server version for the right syntax to use near ‘order’ at line 1 数据库报错如下: Error querying database. Cause: 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 ‘(0) NOT NULL, endTime datetime(0) NOT NULL,avaliableTime int(8) ...
### The error occurred while setting parameters ### SQL: SELECT * FROM Domain_System WHERE domain = ? LIMIT 1 ### Cause: ...
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 'identified by 'password' with grant option' mysql 5和mysql 8都有...
mysql_exporter消除了"Error 1064 (42000): 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 'SLAVE STATUS' at line 1...
前几天帮同事解决一个案例,在主从复制环境下,从库上的MySQL版本号是5.5.5,... Last_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for t
本文实例讲述了mysql报错:...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 1 二、解决方案
ERROR 1064 (42000): 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 'mysqltump -u root -p sa > D:/sa.sql' at line ...
mysqldump: Couldn’t execute ‘SET OPTION SQL_QUOTE_SHOW_CREATE=1’: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ...
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versio····这句话对于咱们并不陌生,无非就是多了“,”之类的问题。但是你如果无意之中添加了一个mysql中的...
check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. 解决方法 解决该问题有两种方法:一种是使用替换法,另一种是使用 PreparedStatemenc 对象...
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 ‘`company_id` int) RETURNS varchar(20) CHARSET utf8 ...
check the manual that corresponds to your MySQL server version for the right syntax to use near '...' at line X",提示SQL语句中的语法错误,需要检查并修正语句。 7. 错误代码1452: "Cannot add or update...
在搭建springmvc框架时,底层使用... 代码如下:[13-04-13 19:11:37.190] {resin-60} You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synt
操作发生错误,相关的信息为:[MySQL][ODBC 3.51 Driver][mysqld-4.0.26-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use ...
check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 MySQL Errno : 1064 Message : MySQL Query 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 'identified by "12345678"' at line 1 的错误,原因是新版本mysql...