Invoking close()
on a ResultSet object that has already been closed has no effect and gives no error.
If you only use rs.close()
you will leak the statement and the connection, which depending on how long lived your application is and whether you create new instances of your dbutil class could cause a database error (for your application, or for others using the same database) due to reaching the maximum number of open cursors (due to un-closed statements) or maximum number of connections (due to un-closed connections).
If you're using Java 7 you should also consider having your dbutil class implement the java.lang.AutoCloseable
interface. That enables you to use the 'try-with-resources' pattern if you have declared your dbutil instance as a local variable. Opening connections to the database is relatively slow though, so you should avoid closing and reopening them lots of times in your application unless you are using connection pooling.