JDBC Reference
Page 11 of 31

java.sql.ResultSet

A positioned update or delete issued against a cursor being accessed through a ResultSet object modifies or deletes the current row of the ResultSet object.

Some intermediate protocols, such as that in Cloudconnector, may pre-fetch rows. This causes positioned updates and deletes to operate against the row the underlying cursor is on, and not the current row of the ResultSet.

Cloudscape provides all the required JDBC 1.2 type conversions of the getXXX methods.

JDBC does not define the sort of rounding to use for ResultSet.getBigDecimal. Cloudscape uses java.math.BigDecimal.ROUND_HALF_DOWN.

Streaming Columns

If the underlying object is itself an OutputStream class, getBinaryStream returns the object directly.

To get a field from the ResultSet using streaming columns, you can use the getXXXStream methods if the type supports it. See Table 6-1 for a list of types that support the various streams. (See also Table 6-3, "Mapping of java.sql.Types to SQL-J Types".)

You can retrieve data from one of the supported data type columns as a stream, whether or not it was stored as a stream.

The following example shows how a user can retrieve a LONG VARCHAR column as a stream:

// retrieve data as a stream
ResultSet rs = s.executeQuery("SELECT b FROM atable");
while (rs.next()) {
    // use an InputStream to get the data
    InputStream ip = rs.getAsciiStream(1);
    // process the stream--this is just a generic way to 
    // print the data
    int c;
    int columnSize = 0;
    byte[] buff = new byte[128];
    for (;;) {
        int size = ip.read(buff);
        if (size == -1)
            break;
        columnSize += size;
        String chunk = new String(buff, 0, size);
        System.out.print(chunk);
    }
}
rs.close();
s.close();
conn.commit();