Question - Why should we close database connections in Java?
Answer -
As a best practice, we must close the resultset, the statement and the connection. If the connection is coming from a pool, on closure, the connection is sent back to the pool for reuse. We are doing this in the finally{} block, because if any exception occurs, then we still get the chance to close this.