Databases Reference
In-Depth Information
in its native format to and from the JDBC driver. Retrieving and sending certain
data types across the network can increase or decrease network traffic.
Performance Tip
For multiuser, multivolume applications, billions, or even trillions, of net-
work packets can move between the driver and the database server over
the course of a day. Choosing data types that are processed efficiently
can incrementally provide a measurable gain in performance.
See “Choosing the Right Data Type,” page 34, for information about which
data types are processed faster than others.
Choosing the Right Cursor
JDBC defines three cursor types:
Forward-only
Insensitive
Sensitive
This section explains how to choose a cursor type for the best performance.
Forward-Only
A forward-only (or nonscrollable) cursor provides excellent performance for
sequential reads of rows in a result set retrieved by a query. Using a forward-only
cursor is the fastest method for retrieving table data in a result set. Because this
cursor type is nonscrollable, you can't use it when the application needs to
process rows in a nonsequential manner. For example, you can't use a forward-
only cursor if you need to process the eighth row in a result set, followed by the
first row, followed by the fourth row, and so on.
Insensitive
An insensitive cursor is ideal for applications that require high levels of concur-
rency on the database server and require the ability to scroll forward and back-
ward through result sets. Most database systems do not support a native
scrollable cursor type. However, most JDBC drivers support insensitive cursors
by emulating this functionality in either of two ways:
 
Search WWH ::




Custom Search