When is ResultSet closed?

后端 未结 3 425
旧巷少年郎
旧巷少年郎 2020-11-30 13:33

I want to know if ResultSet can be closed if I didn\'t close it ? I have a ResultSet is closed exception but I am sure I didn\'t close the ResultSet anywhere . What I do exa

3条回答
  •  日久生厌
    2020-11-30 13:50

    In case you have closed any of the following, your ResultSet will be closed automatically:

    1. Statement object.
    2. Connection object.

    I am strongly suspecting the connection is being closed. It is a natural tendency to close the database connection once the query is run. While it is a good practice, but may be you are closing the connection even before you have used the ResultSet object inside your TableModel class.

提交回复
热议问题