select max(primaryid) from table;
           主键            表名

解决方案 »

  1.   

    呵.这是设计时的失误.
    以前有一个项目也是这样的.
    只好先写入一个uuid了.
      

  2.   

    呵呵! 我那个页面也是查询页面啊,已经写了  select col1,col2,col3 from table1 where.....!  我就是要更新数据集啊,添加时给数据库和数据集同时加一条记录(JDK帮助上说RESULT.INSERTROW是同时更新数据库和数据集的,可我怎么也没法更新啊,UPDATEROW和DELETEROW倒是和帮助上的说的一样,同时更新的),这样我刷新页面时只在取RESULT一次啊,不用再去数据库取数据了啊,速度提高了N倍啊。我现在UPDATE和DELETE根本看不出有一万条数据的页面刷新过,但INSERT重新执行SQL语句要几秒中才能显示数据啊!试了N中方法,初了重新执行SQL,INSERTROW就是不刷新数据集啊! 真是烦死人了!!!
      

  3.   

    没碰到过,做成事务型的立即commit行么?
      

  4.   

    必须有关键字索引,InsertRow后需游标位置定位
      

  5.   

    9731boy(杯子【天天盼着侵略日本的那一天】) :
       能说清楚你是怎么解决这个问题的吗? 谢谢!-------
    还有用了RESULTSET的INSERTROW,UPDATEROW,DELELEROW,那个RESULT的SQL里不能用排序拉,就是ORDER BY, 各位大大有什么解决办法吗!
      

  6.   

    kaibinsj(天翔)
       事务是数据库里执行的啊,我现在数据库又没问题,关键是RESULTSET不能更新,
    注:RESULTSET不从数据库里重新取了!
      

  7.   

    ResultSet.xxxxx_sensetive?这样应该是 可以重新取得可是,怎样操作才能得到 最后的值 我也不知道
      

  8.   

    New rows may be inserted into a result set table and into the underlying database table using new methods in the JDBC 2.0 core API. To make this possible, the API defines the concept of an insert row. This is a special row, associated with the result set but not part of it, that serves as a staging area for building the row that is to be inserted. To access the insert row, an application calls the ResultSet
     method moveToInsertRow, which positions the cursor on the insert row. Then it calls the appropriate updateXXX methods to add column values to the insert row. When all of the columns of the row to be inserted have been set, the application calls the method insertRow. This method adds the insert row to both the result set and the underlying database simultaneously. Finally, the application needs to position the cursor on a row back in the result set.The following code fragment demonstrates these steps for inserting a row from an application written in the Java programming language.
    rs.moveToInsertRow();
    rs.updateObject(1, myArray);
    rs.updateInt(2, 3857);
    rs.updateString(3, "Mysteries");
    rs.insertRow();
    rs.first();
    Several details deserve attention. First, it is possible to retrieve values from the insert row using the ResultSet.getXXX methods. Until a value has been assigned to the insert row with an updateXXX method, however, its contents are undefined. Therefore, if a getXXX method is called after the moveToInsertRow method has been called but before an updateXXX method has been called, the value it returns will be undefined.