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 |
Is it possible to connect to multiple databases simultaneously?
What is the limitation of PreparedStatement and how to overcome it?
Does jpa use jdbc?
what is CallableStatement and what is its usage?
what is connection pooling?
What packages are used by jdbc?
what are the drawbacks of JDBC? explain briefly?
What is the use of getGeneratedKeys() method in Statement?
Is jdbc object oriented?
How to check jdbc connection in java?
How many packages are available in jdbc api?
Give an example for getXXX method?