I have a JDBC query that will generate a huge ResultSet which cannot be stored in memory. To each result some following complex logic should be applied. I don’t want to put everything inside the loop over that resultset. Is it recommanded to use obserber pattern by making the class with JDBC query as Observable? Or should I make that class an Iterator?
I have a JDBC query that will generate a huge ResultSet which cannot be
Share
Whatever the design, you’ll have to loop over the ResultSet. Don’t overengineer what you just need is something like this:
The process method is free to do what it wants : do the job, invoke collaborating objects, etc.