Some JDBC drivers generate a cursor name for any SQL query so that a string can always be returned. However, jConnect does not return a name when ResultSet.getCursorName( ) is called, unless you either
called setFetchSize( ) or setCursorName( ) on the corresponding Statement, or
set the SELECT_OPENS_CURSOR connection property to true, and your query was in the form of SELECT... FOR UPDATE; for example,
select au_id from authors for update
If you do not call setFetchSize( ) or setCursorName( ) on the corresponding Statement, or set the SELECT_OPENS_CURSOR connection property to true, null is returned.
According to the JDBC 2.0 API (chapter 11, “Clarifications”), all other SQL statements do not need to open a cursor and return a name.
For more information on how to use cursors in jConnect, see “Using cursors with result sets”.
Copyright © 2003. Sybase Inc. All rights reserved. |
![]() |