How do I get the size of a java.sql.ResultSet?
Do a SELECT COUNT(*) FROM … query instead. OR In either of the case, you won’t have to loop over the entire data.
Do a SELECT COUNT(*) FROM … query instead. OR In either of the case, you won’t have to loop over the entire data.
The problem is with the way you fetch data in getStuff(). Each time you visit getStuff() you obtain a fresh ResultSet but you don’t close it. This violates the expectation of the Statement class (see here – http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html): By default, only one ResultSet object per Statement object can be open at the same time. Therefore, if the reading of one ResultSet object is … Read more