JDBC drivers generate a cursor name for any SQL query so that a string can always be returned. However, SAP jConnect does not return a name when ResultSet.getCursorName is called.
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 documentation, all other SQL statements do not need to open a cursor and return a name.
For more information on how to use cursors in SAP jConnect, see Cursors with Result Sets.