你创建的是可滚动的结果集吗

解决方案 »

  1.   

    Statement stmt = con.createStatement(
                               ResultSet.TYPE_SCROLL_INSENSITIVE,
                               ResultSet.CONCUR_READ_ONLY );
    ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
    // rs will be scrollable, will not show changes made by others,ResultSet.TYPE_SCROLL_INSENSITIVE支持定位。