I suppose it might. You could spend some time going through the API documentation, or you could spend some time writing a small piece of code and running it. If it were me I would go for the small piece of code.
Just for your information: if you use try-with-resources (since Java 7), the resources will be (automatically) closed in reverse order of the order in which they are created. So using this example, the ResultSet will be closed first, followed by the Statement and finally the Connection
If you have a look at the API documentation of the close() method of the Statement interface, you'll notice this (important) note:
Java Platform, Standard Edition 8 API Specification - Statement wrote:Note: When a Statement object is closed, its current ResultSet object, if one exists, is also closed.
J. Kevin Robbins wrote:Or if you are still stuck on Java 6, you can do it like this. I know this is wordy, but I'm a belt and suspenders kind of guy.
And if you want to get rid of the "wordiness", you simply create a utility class with 3 static methods to close a result set, statement and connection. For exampleAnd then you can have a nice and clean finally blockAnd adding an additional method in DbUtils taking 3 parameters will reduce the finally block to just one line of code.
That's the basic structure (working from memory) to do this without having to check for nulls.
Note, you might want to wrap those closes in try/catches so you don't lose the original problem.
Of course, this is pre try-with-resources.