开发者社区 问答 正文

java连接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 'database='88' where id='1001'' at line 1
代码:
mystatement.executeUpdate("update student set math='"+math+"' ,english='"+english+"', computer='"+computer+"' ,database='"+database+"' "+" where id='"+ID+"'");

展开
收起
蛮大人123 2016-02-21 11:23:59 2395 分享 版权
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    database是关键字,需要转义另外确认id的类型是什么。

    2019-07-17 18:45:49
    赞同 展开评论