InterClient Scrollability

From InterBase

Go Up to Programming with JDBC


The InterClient Connection Class

To achieve JDBC 2.0 core compliance, InterClient now allows a value of TYPE_SCROLL_INSENSITIVE for the resultSetType argument for the following Connection methods:

public java.sql.Statement createStatement (int resultSetType, int resultSetConcurrency)
public java.sql.CallableStatement prepareCall (String sql, int resultSetType, int resultSetConcurrency)
public java.sql.PreparedStatement prepareStatement (String sql, int resultSetType, int resultSetConcurrency)
Previously, the only allowable value for resultSetType was TYPE_FORWARD_ONLY. Currently, the only type not allowed is the TYPE_SCROLL_SENSITIVE

The ResultSet Class

The resultSetType property of the ResultSet class can now have a value of TYPE_SCROLL_INSENSITIVE Previously, the only allowable value for resultSetType was TYPE_FORWARD_ONLY. Currently, the only type not allowed is the TYPE_SCROLL_SENSITIVE.

The following methods now return a valid value when the resultSets that are of the new resultSetType.TYPE_SCROLL_INSENSITIVE:

public boolean isBeforeFirst()
public boolean isAfterLast()
public boolean isFirst()
public isLast()
public void beforeFirst()
public void afterLast()
public boolean first()
public boolean last()
public int getRow()
public boolean absolute(int row)
public boolean relative(int rows)
public boolean previous()

Additional Functions

Additional functions that implement the JDBC 2.x API functionality are listed below.

Function Functionality

int Statement.getResultSetType()

Returns the type if resultSet is open, otherwise throws an exception

int Statement. getResultSetConcurreny()

Returns the concurrency if resultSet is open.

int Statement. getFetchDirection()

Returns the fetch direction if resultSet is open, the return value is always FETCH_FORWARD for InterBase.

int ResultSet. getFetchDirection()

Returns FETCH_FORWARD in all cases

int ResultSet. getFetchSize()

Returns the fetch size for the result set of the statement.

int ResultSet. setFetchSize()

Allows you to set the fetch size of the resultset and the statement.

int ResultSet. setFetchDirection()

Throws an exception; it can only work with TYPE_SCROLL_SENSITIVE and TYPE_SCROLL_INSENSITIVE. Neither of these are supported by InterBase, since InterBase does not support scrollable cursors. The only ResultSet type allowed by InterClient/InterBase is TYPE_FORWARD_ONLY.

Advance To: