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 drivers available?
What is the full form of jdbc and what is its purpose?
What is a datasource in java?
What is a jdbctemplate?
What is odbc and jdbc?
What is difference between odbc and jdbc?
Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?
What is a connection string used for?
How can we store and retrieve images from the database?
What are the steps to connect to a database in java?
How can you load the drivers in jdbc?
what does the method Class.forName returns?