Originally posted by Thennam Pandian: what is the use of setFetchSize method in ResultSet? ( Already Statement has setFetchSize method)
The answer to the second question comes straight from the ResultSet API:
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this ResultSet object ... The default value is set by the Statement object that created the result set.
Thennam, 1) All of them 2) The default value of what? maxRows defaults to returning all the rows 3) maxRows is the number of rows that can be returned overall. fetchSize is the number that will be returned in each database roundtrip
Thennam, Normally, I wouldn't use either one. If I learned I had a network traffic problem, I might try increasing the fetch size. I would never use maxRows because I prefer limiting the rows from the SQL itself.
Originally posted by Jeanne Boyarsky: I would never use maxRows because I prefer limiting the rows from the SQL itself.
Since the SQL based 'fetch size' solutions are DB dependent, I guess you could use maxRows if you wanted a DB agnostic solution. Having said that, everyone I know would make the same decision as Jeanne.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: what is the use of setFetchSize and setMaxRows methods in Statement.