Hello, Good question. The ResultQuery.fetchLazy(int) method sets the JDBC fetch size flag onto the underlying JDBC Statement. This is used to tell your JDBC driver how many records should be fetched into the driver's internal cache at the same time. In other words, these two correspond to each other: - http://www.jooq.org/javadoc/latest/org/jooq/ResultQuery.html#fetchLazy(int) - http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html?is-external=true#setFetchSize(int)
The Cursor.fetch(int) method has nothing to do with JDBC. cursor.fetch(3) has the same semantics as for (int i = 0; i < 3; i++) cursor.fetchOne(); - http://www.jooq.org/javadoc/latest/org/jooq/Cursor.html#fetch(int) Note that with jOOQ 3.3, ResultQuery.fetchLazy(int) will be deprecated in favour of a new ResultQuery DSL method: - https://github.com/jOOQ/jOOQ/issues/2806 Hope this helps Lukas 2013/11/12 <[email protected]> > Hi all, > > I would like to know the difference between defining a fetch size on > fetchLazy (when declaring the cursor) ( org.jooq.ResultQuery.fetchLazy(int > fetchSize) ) and on the fetch statement itself (when retrieving > values) Result<Record> org.jooq.Cursor.fetch(int number) throws > DataAccessException. > > How these relate to each other? Does the value on fetch override the value > declared on fetchLazy (when declaring the cursor)? > > Thank you > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
