p前面怎么有个引号,如果p是常量,只要 把item2改成item3的写法就行了

解决方案 »

  1.   

    final String p="'";
    p就是'号
      

  2.   

    我现在就是不知道该如果让item1来替代usename使这个列成为动态的。
      

  3.   

    我如果把item1改成这样的话<%stmt.executeUpdate("update yhm set '"+item1+"'='"+item3+"' where xh="+p+item2+p);%>
    运行时系统就会提示
    org.apache.jasper.JasperException: Syntax error or access violation: You have an error in your SQL syntax near ''usename'='rrr' where xh='1'' at line 1
    谁可以帮帮我?谢谢!
      

  4.   

    "update yhm set "+item1+" ='"+item3+"' where xh="+p+item2+p);%>不行吗??????
      

  5.   

    谢谢,ZEZ你的方法可行。如果方便能讲解一下吗?