Databases Reference
In-Depth Information
Clob value? All result rows, including the long data, would be retrieved and
cached. This operation could quickly consume available memory on the driver
machine. In this case, it's best to use a forward-only or sensitive cursor.
Sensitive
A sensitive cursor picks up data modifications in the database that affect the
result set and is useful for applications that have the following characteristics:
Provide forward and backward access to data
Access data that changes frequently
Retrieve a large number of rows and can't afford to pay the performance
penalty associated with emulated insensitive cursors
Sometimes known as keyset-driven cursors, sensitive cursors, similar to
insensitive cursors, often are emulated by JDBC drivers because they're not sup-
ported natively by the database.
Because sensitive cursors provide access to up-to-date data, the JDBC driver
can't retrieve result rows and cache them on the driver machine because the val-
ues of the data stored in the database may change after they are cached. Instead,
most drivers emulate sensitive cursors by modifying the query before it's sent to
the database to include a key or a pseudo-column that serves as a key. When a
sensitive cursor is requested, the driver retrieves the keys for every result row and
caches those keys on the driver machine. When the application positions to a
row, the driver looks up the value of the key associated with the requested row
and executes a SQL statement using the key in the Where clause to ensure that
only one result row, the one requested by the application, is retrieved.
For example, an Oracle JDBC driver may emulate a sensitive scrollable cur-
sor in the following way:
Application Request
Driver Actions
executeQuery ("SELECT 1. The driver sends the following statement to the Oracle
name, addr, picture
database:
FROM employees WHERE
SELECT rowid FROM employees WHERE location =
location = 'Raleigh'")
'Raleigh'
2. The driver retrieves all result ROWID s and caches them
locally.
3. The driver prepares the following statement to the Oracle
database for future use:
SELECT name, addr, picture FROM employees
WHERE ROWID = ?
Search WWH ::




Custom Search