SAP jConnect supports TYPE_SCROLL_INSENSITIVE result sets.
SAP jConnect uses the Tabular Data Stream (TDS)— its proprietary protocol—to communicate with SAP database servers. SAP Adaptive Server 15.0 and later supports TDS scrollable cursors. For servers that do not support TDS scrollable cursors, SAP jConnect caches the row data on demand, on the client, on each call to ResultSet.next. However, when the end of the result set is reached, the entire result set is stored in the client memory. Because this may cause a performance strain, SAP recommends that you use TYPE_SCROLL_INSENSITIVE result sets only with SAP Adaptive Server 15.0 or when the result set is reasonably small.
SAP jConnect provides the ExtendResultSet in the sample2 directory; this sample provides a limited TYPE_SCROLL_INSENSITIVE ResultSet using JDBC 1.0 interfaces.
This implementation uses standard JDBC 1.0 methods to produce a scroll-insensitive, read-only result set, that is, a static view of the underlying data that is insensitive to changes made while the result set is open. ExtendedResultSet caches all of the ResultSet rows on the client. Be cautious when you use this class with large result sets.
The methods from the JDBC 2.0 API are:
boolean previous() throws SQLException;
boolean absolute(int row) throws SQLException; boolean relative(int rows) throws SQLException;
boolean first() throws SQLException; boolean last() throws SQLException; void beforeFirst() throws SQLException; void afterLast() throws SQLException;
boolean isFirst() throws SQLException; boolean isLast() throws SQLException; boolean isBeforeFirst() throws SQLException; boolean isAfterLast() throws SQLException;
int getFetchSize() throws SQLException; void setFetchSize(int rows) throws SQLException; int getFetchDirection() throws SQLException; void setFetchDirection(int direction) throws SQLException;
int getType() throws SQLException; int getConcurrency() throws SQLException; int getRow() throws SQLException;
// import the sample files import sample.*;
//import the JDBC 1.0 classes import java.sql.*;
// connect to some db using some driver; // create a statement and a query;
// Get a reference to a JDBC 1.0 ResultSet ResultSet rs = stmt.executeQuery(_query);
// Create a ScrollableResultSet with it ScrollableResultSet srs = new ExtendedResultSet(rs);
// invoke methods from the JDBC 2.0 API srs.beforeFirst();
// or invoke methods from the JDBC 1.0 API if (srs.next()) String column1 = srs.getString(1);
See the JDBC 2.0 API at Oracle Technology Network for Java for more details.