Re: Why rs...still connected
I'm no expert when it comes to this area but could you provide your code where you initialise your Connection, Statement and ResultSet Objects in case you're pooling the connection, though it's just a stab in the dark.
Re: Why rs...still connected
The logic in the code snippet does not evaluate the status of the connection, it evaluates if rs is null (calling close on a stream/resultset/etc...does not nullify the object reference).
Re: Why rs...still connected
And if it was null, you would never make it to that null check, because a NullPointerException would be thrown when you called close()