首页 > 其他 > 详细

Can not issue data manipulation statements with executeQuery()

时间:2018-07-09 18:26:57      阅读:155      评论:0      收藏:0      [点我收藏+]

Can not issue data manipulation statements with executeQuery()

 

原因是这句:st.executeQuery("insert  into  student  values(‘"+name+"‘,‘"+age+"‘,‘"+introduce+"‘)") ;

我是看了书上一个例子,然后开始模仿,发现问题后,发现书上其他程序语句都是用这句,

后来看了几个网页,才明白这句应该该成这样子:st.execute("insert  into  student  values(‘"+name+"‘,‘"+age+"‘,‘"+introduce+"‘)") ;

最后总结:如果你的SQL 语句是诸如update,insert的更新语句,应该用statement的execute()方法,如果用的是statement的executeQuery()就会出现上诉问题

转自:https://blog.csdn.net/cherishme1988/article/details/7399225

Can not issue data manipulation statements with executeQuery()

原文:https://www.cnblogs.com/xiaodongxiaodong/p/9284907.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!