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'");

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

原文地址:https://www.cnblogs.com/AbsolutelyPerfect/p/7810285.html