Fix CID-1212194 Resource like dues to left-open statements and
resultsets
Fix CID-1147052 Use try-with-resources to fix the leak