sql server 有一个变量.楼主msdn搜一下就知道了..
其它数据库不熟悉

解决方案 »

  1.   

    declare @id int
    select @id=你的主键名称 from inserted
      

  2.   

    rs.moveToInsertRow(); // moves cursor to the insert row
           rs.updateInt(2,35); // updates the second column to be 35
           rs.updateBoolean(3, true); // updates the third column to true
           rs.insertRow();
           rs.moveToCurrentRow();
      

  3.   

    直接在SQL语句里面写啊。。比如你用的是oracle序列的话,就这样写:select 序列名.nextval from dual