What will happen when ResultSet is not closed?
Answer Posted / 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 |
Post New Answer View All Answers
How to connect html page to database using jdbc?
How can you use preparedstatement in jdbc?
Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?
What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?
What are different types of JDBC Drivers?
What are devices?
Why isn't the java.sql.DriverManager class being found?
What is a jdbc connection string?
What is the use of jdbc api?
What does executeupdate return in java?
Does the database server have to be running Java or have Java support in order for my remote JDBC client app to access the database?
What class.forname does, while loading the drivers?
What types of DataSource objects are specified in the Optional Package?
What is meant by dao?
How can we execute stored procedures?