cactoos-jdbc icon indicating copy to clipboard operation
cactoos-jdbc copied to clipboard

Results class, what is it for?

Open mdbs99 opened this issue 6 years ago • 2 comments

I haven't understand this part. There is a loop and the val variable is replaced every time in the loop. Why is that?

mdbs99 avatar Jun 04 '18 00:06 mdbs99

@ mdbs99 Yeah, you're completely right. It's not the best way to do it. In this code we just want to execute all statements and get only the last result. We can do it using a for, but in this way it's cleaner ... But I'll keep this issue open to think better on it. Any suggestion?

fabriciofx avatar Jun 04 '18 17:06 fabriciofx

Any suggestion?

Concatenate all results before return the value.

mdbs99 avatar Jun 04 '18 19:06 mdbs99