How can I avoid ResultSet is closed exception in Java?

前端 未结 10 1009
渐次进展
渐次进展 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:44

    I got same error everything was correct only i was using same statement interface object to execute and update the database. After separating i.e. using different objects of statement interface for updating and executing query i resolved this error. i.e. do get rid from this do not use same statement object for both updating and executing the query.

提交回复
热议问题