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


Please Help Members By Posting Answers For Below Questions

How to connect html page to database using jdbc?

494


How can you use preparedstatement in jdbc?

522


Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?

492


What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?

516


What are different types of JDBC Drivers?

536






What are devices?

496


Why isn't the java.sql.DriverManager class being found?

572


What is a jdbc connection string?

466


What is the use of jdbc api?

511


What does executeupdate return in java?

501


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?

526


What class.forname does, while loading the drivers?

541


What types of DataSource objects are specified in the Optional Package?

511


What is meant by dao?

522


How can we execute stored procedures?

574