Home
| FAQ
| Documentation
| Links
| License
| Project Info
| Download
| News
| Bugs
| Forums
jTDS result set information
jTDS supports the following result set types on MS SQL Server.
Result Set Type | Result Set Concurrency | Supported | Comments |
FORWARD_ONLY | READ_ONLY | Yes | Default result set using a direct select. |
FORWARD_ONLY | UPDATEABLE | Yes | Uses a forward_only dynamic scroll_locks cursor. |
SCROLL_INSENSITIVE | READ_ONLY | Yes | Uses a scroll static read_only cursor. |
SCROLL_INSENSITIVE | UPDATEABLE | No | Cursor downgraded to SCROLL_SENSITIVE. |
SCROLL_SENSITIVE | READ_ONLY | Yes | Uses a scroll keyset read_only cursor. |
SCROLL_SENSITIVE | UPDATEABLE | Yes | Uses a scroll keyset scroll_locks cursor. |
jTDS supports the following result set types on Sybase.
Result Set Type | Result Set Concurrency | Supported | Comments |
FORWARD_ONLY | READ_ONLY | Yes | Default result set using a direct select. |
FORWARD_ONLY | UPDATEABLE | Yes | Uses a client side cursor with optimistic locking. |
SCROLL_INSENSITIVE | READ_ONLY | Yes | Uses a client side cursor. |
SCROLL_INSENSITIVE | UPDATEABLE | Yes | Uses a client side cursor with optimistic locking. |
SCROLL_SENSITIVE | READ_ONLY | Yes | Uses a client side cursor. |
SCROLL_SENSITIVE | UPDATEABLE | Yes | Uses a client side cursor with optimistic locking. |
Notes:
- Updateable result sets can only be built from select statements containing one base table.
- Tables used to build UPDATEABLE and SCROLL_SENSITIVE result sets should have primary keys.
- Use the Statement.getWarnings() and ResultSet.getWarnings() methods to check that the actual result set
returned has not been downgraded, for example from updateable to read only.
- For SQL Server cursors the fetch size defaults to 100 rows while for Sybase the entire result set is cached in the
client. Therefore care must be taken with Sybase to limit the size of result sets to avoid "out of memory" errors.
Support for positioned updates:
- Positioned updates are supported on both SQL Server and Sybase using forward only server cursors.
- For named cursors to be used for positioned updates the fetch size defaults to 1.
- Use the Statement.setCursorName() method to set the cursor name.
- Use the ResultSet.getCursorName() method to obtain the cursor name for use in the "where current of" clause.
- If there is no intention to actually update the cursor then the ResultSet.setFetchSize() method can be used to
increase the fetch size from it's default of 1. This mode allows efficient sequential access to large result sets
without the risk of the driver caching large amounts of data.
|