I have a program in C # that iterates a very large database query using yield return. Then the calling method works on each object, calling IEnumerable in parallel.for each. Java does not have profitability, all implementations that I have seen to return profitability in Java are very messy.
Is there any other way to suggest string streams from dB to the calling method? So far I am thinking about using the methods that we need to run inside the SQL iterator (we use jdbc), but it also makes it difficult to view the code, since it hides some critical methods inside the reader loop.
I would provide a sample code, but I hope for a higher level idea, since this problem along with reading very large text files is common for us, returning C # yield was awesome.
source share