【发布时间】:2017-05-17 21:07:11
【问题描述】:
这是 y 插入语法
String add="INSERT INTO time_table VALUES("+coursename+"','"+coursecode+"','"+days+"','"+year+"','"+dep+"','"+time+"','"+hall+"','"+lecturer+"','"+credithours+"')";
错误
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 '','5','2','2','8','1','9','PA','2')' at line 1
这就是我收到的错误。
【问题讨论】:
-
你的time_table表结构是什么?如果您不指定列名,则预计您将按照与数据库中定义的顺序相同的顺序为所有列传递数据。