开发者社区> 问答> 正文

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 2271 0
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

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

    2019-07-17 18:45:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载

相关镜像