jdbc连Mysql更新数据报错:java.sql.SQLException:Can not issue data manipulation statements with executeQuery()

报错代码:

sql.executeQuery("update allid set pw = '222' where id='001'");

哎,就是因为我太白了,才会犯这个错。

executeQuery:执行查询。所以它的参数应该为查询语句。

改正代码:

sql.execute("update allid set pw = '222' where id='001'");

做完这个系统就能黑点了,加油,呵哈哈。

posted @ 2017-11-09 16:56  深圳地铁Princess  阅读(376)  评论(0)    收藏  举报