pseudo code to explain my self better. I'm learning Java at this point in time.
if I have a method
public resultSet getEverything()
{
resultSet rs = blabla;
return rs
}
I can't rs.close()
as I need to use it in the method I retrieve it
hence then I will use it, and maybe 'close' the new resultSet I create.
What happens from the previous resultSet? Is it left to be collected by the garbage collector? Does it close itself when I close the 'new' resultSet? Does it have any impact on code efficiency/performance?
Any feedback would be greatly appreciated :) as this has confused me a bit. It is more of an OOP question rather than Java I think. Thanks!