Added code to close ResultSet, Statement, and JDBC connection appropriately.