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 |
can we define indexes on a foreign key? Explain pros and cons?
What does the jdbc resultsetmetadata interface?
What class.forname will do while loading drivers of jdbc?
Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?
What do you mean by metadata and why we are using it?
How warnings are retrieved in JDBC?
Stored procedure purpose?
How do I find ojdbc jar version?
Why do I have to reaccess the database for Array, Blob, and Clob data?
What is an outer join?
Where can I find info, frameworks and example source for writing a JDBC driver?
What is DML?