Rollerball
Rollerball

Reputation: 13118

About resultset type JDBC

In this oracle java tutorial, it says:

TYPE_FORWARD_ONLY: The result set cannot be scrolled; its cursor moves forward only, from before the first row to after the last row. The rows contained in the result set depend on how the underlying database generates the results. That is, it contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.

"The rows contained in the result set depend on how the underlying database generates the results."

What's the difference between the query execution time and rows retrieving time? And how can I know which my database supports? Thanks in advance.

Upvotes: 0

Views: 175

Answers (1)

duffymo
duffymo

Reputation: 309008

It's the difference between eager and lazy loading. I'd recommend researching those terms.

Eager loading means all the results are made available at once. It could require a great deal of time and memory if the set is large.

Lazy loading doles out results as needed. It's along the lines of what Google does when you search for pages: they'll find millions, but only return them 25 at time with higher ranks first.

Upvotes: 3

Related Questions