JDBC Reference
Page 8 of 31

java.sql.Statement

ResultSet Objects

An error that occurs when a SELECT statement is first executed prevents a ResultSet object from being opened on it. The same error does not close the ResultSet if it occurs after the ResultSet has been opened.

For example, a divide-by-zero error that happens while the executeQuery method is called on a java.sql.Statement or java.sql.PreparedStatement throws an exception and returns no result set at all, while if the same error happens while the next method is called on a ResultSet object, it does not cause the result set to be closed.

Errors can happen when a ResultSet is first being created if the system partially executes the query before the first row is fetched. This can happen on any query that uses more than one table and on queries that use aggregates, GROUP BY, ORDER BY, DISTINCT, or UNION.

To satisfy the JDBC interface, executeQuery used on a non-query statement returns an empty ResultSet object with no columns.

Closing a Statement causes an open ResultSet object on that statement to be closed as well.

The cursor name for the cursor of a ResultSet can be set before the statement is executed. However, once it is executed, the cursor name cannot be altered.

java.sql.Statement Functionality Not Supported

Cloudscape does not implement the following JDBC 1.2 methods of java.sql.Statement:

  • cancel
  • setEscapeProcessing
  • getQueryTimeout and setQueryTimeout

In addition, no SQL-J statements return multiple ResultSets; this means that getMoreResults always closes the current ResultSet and returns false.