This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The biggest problem is that it becomes very difficult to clean up your resources. There are two separate issues. First, you have to make sure that every place where this method is called, once the ResultSet is fully processed, that "close()" is called. If you are writing all of the code that access this method, then you have control over that. If you allow other people access to this method, you have to hope that they call "close()", but you have no direct control over it. Second, even if you manage to call "close()" on every ResultSet that gets returned, how do you close the Statement (stmt)? Your "stmt" variable goes out of scope once the method returns, and so Java can do a little garbage collecting since there are no references to it, but there is no way you can call "close()" on it. So the database can/may/will have resources tied up that are never freed. So it's a bad idea to do this.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com