What will happen when ResultSet is not closed?
Answer / sekhar reddy
It also depends on the JDBC driver and it would also not happen if it is a pooled connection. A pooled connection is returned to the pool and would only actually be closed later when its lifetime has expired. In the meanwhile easily more than thousands statements and/or resultsets might have been opened and left unclosed.
However that presumes
- That the driver does do that.
- That the connection close actually cleans the resources.
There was an Oracle driver that did not do the second.
| Is This Answer Correct ? | 0 Yes | 3 No |
What are the measures to connect to the db using jdbc?
How can you make a connection?
Is jdbc open source?
How can you sort dates?
How can I instantiate and load a new CachedRowSet object from a non-JDBC source?
What is difference between java.util.Date and java.sql.Date?
What is ojdbc14 jar?
How to check null value in JDBC?
What does the jdbc resultsetmetadata interface?
how can we get the metaData (columnNames) from a table which has no Records..
Why we use while rs next ())?
How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?