How can I avoid ResultSet is closed exception in Java?

前端 未结 10 1010
渐次进展
渐次进展 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条回答
  •  萌比男神i
    2020-11-28 10:34

    The exception states that your result is closed. You should examine your code and look for all location where you issue a ResultSet.close() call. Also look for Statement.close() and Connection.close(). For sure, one of them gets called before rs.next() is called.

提交回复
热议问题