Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java INSERT INTO语法似乎正确,但仍然失败_Java_Mysql_Syntax_Jax Ws_Insert Into - Fatal编程技术网

Java INSERT INTO语法似乎正确,但仍然失败

Java INSERT INTO语法似乎正确,但仍然失败,java,mysql,syntax,jax-ws,insert-into,Java,Mysql,Syntax,Jax Ws,Insert Into,有人能快点帮我吗?自从这篇文章发表以来,我已经坐了一个小时了 注意:null是一个字符串,实际上不是null值。。。本质上应该与使用“Hello”作为值相同 INSERT INTO tasks (category,completion_dtm,desc,duedate,notification_duedate,notification_one,notification_two,priority,reminder_one,reminder_two,title,timestamp) VALUES('

有人能快点帮我吗?自从这篇文章发表以来,我已经坐了一个小时了

注意:null是一个字符串,实际上不是null值。。。本质上应该与使用“Hello”作为值相同

INSERT INTO tasks (category,completion_dtm,desc,duedate,notification_duedate,notification_one,notification_two,priority,reminder_one,reminder_two,title,timestamp) VALUES('None','3999-01-01 00:00:00','(null)',('1000-01-01 00:00:00'),'(null)','(null)','(null)',2,('1000-01-01 00:00:00'),('1000-01-01 00:00:00'),'Task 3',('1000-01-01 00:00:00')) ON DUPLICATE KEY UPDATE id=VALUES(id)
我的语法有什么问题吗?谢谢你的洞察力

编辑: 抱歉,我认为错误很明显:

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 'desc,duedate,notification_duedate,notification_one,notification_two,priority,rem' at line 1
乍一看-

desc是一个符号,您必须将其括在backticks中``

NSERT INTO tasks (category,completion_dtm,`desc`,duedate,notification_duedate,notification_one,notification_two,priority,reminder_one,reminder_two,title,timestamp) VALUES('None','3999-01-01 00:00:00','(null)',('1000-01-01 00:00:00'),'(null)','(null)','(null)',2,('1000-01-01 00:00:00'),('1000-01-01 00:00:00'),'Task 3',('1000-01-01 00:00:00')) ON DUPLICATE KEY UPDATE id=VALUES(id)

如果您发布了确切的SQL错误消息,我们可以提供更接近的答案。

您有与mysql关键字匹配的列名,请在列名中使用反勾号。

除了desc是关键字外,还值得检查您在日期上指定的值。我相信您已经超过了允许的日期限制或少于允许的最低日期。首先检查语句是否成功,日期是否为当前日期。

给出的错误是什么?您会遇到哪些SQL错误?我将把我所有的desc用法重命名为其他名称,如果是问题,我会将您的答案标记为正确。否则我会将较小的日期改为1760,我想最小值可能是1753或接近1753。desc关键字似乎是问题所在,我重命名了我的表和java变量以防万一,它解决了我的问题!谢谢你发现它!是的,梅尔文·普罗塔西奥好心地告诉我这是矛盾的:谢谢你的回复!梅尔文·普罗塔西奥让我知道了这场冲突,所以我很快就解决了。但是你的职位!