Actually you are creating
three ResultSets in that code.
You only have one variable to assign them to, though, so only the last of the three gets closed properly. It's true that the API document for Statement says "All execution methods in the Statement interface implicitly close a statment's current ResultSet object if an open one exists", so that should mean that the Statement will close the first ResultSet when it creates the second one. However it's possible that
JDBC drivers might not implement that rule correctly, so you ought to close each ResultSet after you finish using it.