This code should be removed.  executeBatch is missing a call to closeResultSets, which would close all activeResultSets, at the outset of the method; which all executeXXX methods are required to do.  generatedKeysResultSet is in the activeResultSets list.