java.sql.SQLException: Exhausted Resultset
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)java
出現這個錯誤的緣由是由於ResultSet curser 指針已經在最後一個元素以外了,說明要麼是ResultSet 集合爲空,要麼是集合已經沒有能夠讀取的元素了,此時你再調用rs.get()獲取元素,就會報錯。sql
if (rs! = null) { while (rs.next()) { count = rs.getInt(1); } count = rs.getInt(1); //this will throw Exhausted resultset }