strSQL怎么是int型呢?还赋了那么长的值

解决方案 »

  1.   

    你在定义strSQL变量时定义为int,而应该定义为String类型就可以了
      

  2.   

    String strSQL="update tempdb..tyh"+name+" set ye=ye+"+ye1+" where zh='"+rs2.getString("k_zh")+"' ";
    rs1 = stmt3.executeUpdate(strSQL);
      

  3.   

    看不出来,代码多贴点,异常信息贴出来。你不会是int strSQL = ..............吧。赫赫
      

  4.   

    stmt3.executeUpdate(strSQL);
    它的返回值是一个int 型,所以不能执行啊;
    应改为 int i=stmt3.executeUpdate(strSQL);
      

  5.   

    String strSQL = new String();  定义的就是String,真实奇怪阿!先谢谢各位。
      

  6.   

    到底要怎么写才能对?用execute到是可以编译通过……
      

  7.   

    stmt3.executeUpdate(strSQL)的返回值是一个int型,表示语句影响的行数。
      

  8.   

    <<编译不通过,显示strSQL为int型,ResultSet对象rs1无法获得.>>Statement.executeUpdate 返回 int 类型,你要在前面放一个 ResultSet rs1,谁能给你编译通过啊?
    你做update那里会有ResultSet返回。
      

  9.   

    rs1 = stmt3.executeUpdate(strSQL); ///wrong here!!
    int i=stmt3.executeUpdate(strSQL);////right;