Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Prefetching

JDBC 2.0 allows you to specify for a query the number of rows retrieved at a time with each database round-trip. This number is known as the fetch size, and the process of getting rows in advance is called prefetching. The default value of a fetch size in Oracle JDBC is 10. This means that by default, when you execute a query, the JDBC driver retrieves ten rows at a time per round-trip. By changing this number, you can control the number of round-trips your queries make to the database. For example, with the default fetch size value of 10, a query resulting in a total of 100 rows would actually make 11 round-trips (the eleventh round-trip is required to detect that the query has no more rows to return). But if you use a fetch size of, say, 50, the query would make only three round-trips to fetch 100 rows.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial