How can I avoid ResultSet is closed exception in Java?

前端 未结 10 1027
渐次进展
渐次进展 2020-11-28 09:51

As soon as my code gets to my while(rs.next()) loop it produces the ResultSet is closed exception. What causes this exception and how can I correct

10条回答
  •  盖世英雄少女心
    2020-11-28 10:42

    Also, you can only have one result set open from each statement. So if you are iterating through two result sets at the same time, make sure they are executed on different statements. Opening a second result set on one statement will implicitly close the first. http://java.sun.com/javase/6/docs/api/java/sql/Statement.html

提交回复
热议问题