Category: pmd
Rule Key: pmd:CloseResource
⚠️ This rule is deprecated in favour of S2095.
Ensure that resources (like Connection, Statement, and ResultSet objects) are always closed after use. It does this by looking for code patterned like :
Connection c = openConnection(); try { // do stuff, and maybe catch something } finally { c.close(); }