程序运行时报错:语法错误,保忙一改吧,顺边解释解释!
stmt.executeUpdate("Update ifo set 年龄 = 年龄 +" + "sum" + "where 年龄 =1 ");

解决方案 »

  1.   

    sum是变量嘛?
    如果是,应该为stmt.executeUpdate("Update ifo set 年龄 = 年龄 +" + sum + "where 年龄 =1 ");
    如果不是,请问ifo字段是什么类型?
      

  2.   

    stmt.executeUpdate("Update ifo set ago = '"+"年龄" + "' ,sum='"+"30" + "where ago =1 ");
      

  3.   

    ("Update ifo set 年龄 = 年龄 +'" + sum + "'where 年龄 =1 ");
      

  4.   

    ("Update ifo set 年龄 = 年龄 +" + sum + " where 年龄 =1 ");
      

  5.   

    stmt.executeUpdate("Update ifo set 年龄 = 年龄 +" + sum + "where 年龄 =1 ");
      

  6.   

    stmt.executeUpdate("Update ifo set 年龄 = 年龄 +" + sum+ "where 年龄 =1 "); sum   应该是个变量吧,不能引起来的