if (password.equals(rspassword))
{
String sql="update admini set password= ? where identid="+identid2+";";
漏了'号
if (password.equals(rspassword))
{
String sql="update admini set password= ? where identid='"+identid2+"';";

解决方案 »

  1.   

    to ycats(加菲猫)
    呵呵
    不好意思
    粗心大意另外问句:
    程序
    需要statement.close()吗
    我的书上怎么都不用这一句的啊?
      

  2.   

    很多时候statement.close()会被自动调用的。比如关掉连接的时候,换statement的时候。
      

  3.   

    在很多情况下,在语句自动关闭时立即释放该语句的数据库和 JDBC 资源是需要的;close 方法就是这种立即释放方法。 
      

  4.   

    see the JDK Documents
    Statemet close()
    Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed. It is generally good practice to release resources as soon as you are finished with them to avoid tying up database resources. 
    Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed, its current ResultSet, if one exists, is also closed. 
      

  5.   

    ycats(加菲猫) 老大
    刚刚回去试了一下
    改成了
    String sql="update admini set password= ? where identid='"+identid2+"';";
    可是还是出现
    [Microsoft][ODBC SQL Server Driver]????????? hstmt 
    完了
    怎么办啊
      

  6.   

    如果这个程序改成access就没有问题了
    我现在用的是sql server
    ??????
    一头雾水
      

  7.   

    改一改异常输出
    catch (SQLException e)
    {
    out.println(e.getMessage()+"  SQLSTATE="+e.getSQLState());
    }
      

  8.   

    应该有两中可能,一种是中文问题,更有可能的一种是
    取列的顺序不对,你不要用select * ,直接去该字段就可以了
      

  9.   

    just try close statement before create pstmt
      

  10.   

    just try close statement before create pstmt