对只转发结果集的无效操作: last
java.sql.SQLException: 对只转发结果集的无效操作: last
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.driver.BaseResultSet.last(BaseResultSet.java:91)
at E21NumberingPlanDiscrepancyAlert.getRegionPrefix(E21NumberingPlanDiscrepancyAlert.java:54)
at E21NumberingPlanDiscrepancyAlert.main(E21NumberingPlanDiscrepancyAlert.java:14)
查找除原因是prepareStatement需要重新定义
把
- pstmt = sqlCon.prepareStatement(sql);
pstmt = sqlCon.prepareStatement(sql);
改成
- pstmt = sqlCon.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
pstmt = sqlCon.prepareStatement(sql,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); 就可以了