日期:2014-05-18  浏览次数:20594 次

jsp中更新数据遇到问题,请高手指点!在线等


原码如下:

if   (i==100){
                        try{
sql1= "UPDATE   app_hh_mag   SET   password= ' "+nkey+ " '   where   manager= ' "+name1+ " ' ";
        RScount=stmt.executeQuery(sql1);
      }
catch   (SQLException   e){
                                              out.print(e);
                                            }
//response.sendRedirect( "login.jsp ");
out.print(RScount);
                        }
报错内容是:
java.sql.SQLException:   Can   not   issue   data   manipulation   statements   with   executeQuery()org.apache.tomcat.dbcp.dbcp.DelegatingResultSet@13a1778

不知道错在哪里。

------解决方案--------------------
RScount=stmt.executeUpdate(sql1);

改成

stmt.executeUpdate(sql1);

更新不需要返回结果