各位大虾:
     jdbc里更新记录语句如下:
     String sql="update table1 set ...";
     st=conn.createStatement();
     st.executeUpdate(sql);
     有什么方法得到update的记录数?就是sql语句更新了 多少行记录?
     谢谢

解决方案 »

  1.   

    这都问出来了~汗死~~
    st.executeUpdate(sql);这个东东要返回个INT的数回来~
    你加个变量接收就知道对多少记录进行了操作~
    如:
    int i=st.executeUpdate(sql);
      

  2.   

    executeUpdate() 
              Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement.
      

  3.   

    dui对,executeUpdate() 的返回值就是更新的记录数