Refactored code to utilize try-with-resources for JDBC operations, ensuring
automatic resource management (ARM) compliance. This change improves code
readability and reliability by eliminating the need for explicit resource
closure, reducing the risk of resource leaks.