This is useful if you want the currently executing method to still throw the exception while allowing resources to be cleaned up appropriately. Below is a concrete example of handling the exception from a calling method.
public void yourOtherMethod() {
try {
yourMethod();
} catch (YourException ex) {
// handle exception
}
}
public void yourMethod() throws YourException {
try {
db.store(mydata);
} finally {
db.cleanup();
}
}