这句话在运行的时候会报javax.servlet.ServletException:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'id = 26' at line 1
这种错误,想了很长时间,原来是where前面少了一个空格。
正确的是
stmt.executeUpdate("update article set rootid="+rootid+" where id="+rootid);
哎,粗心啊。看来还是经验不够。
加倍学习,积累经验.