In java, exists the try-with-resources:
try(Connection c = driver.open... ) { }
This guarantees that when the code exits the try block, the