background image
<< java.sql.ResultSet interface | java.sql.ResultSetMetaData interface >>

ResultSets and streaming columns

<< java.sql.ResultSet interface | java.sql.ResultSetMetaData interface >>
Derby Reference Manual
315
Returns
Signature
Implementation Notes
ResultSet.CONCUR_READ_ONLY.
But if the Statement object has
CONCUR_UPDATABLE concurrency, then
the return value will depend on whether
the underlying language ResultSet is
updatable or not. If the language ResultSet
is updatable, then getConcurrency() will
return ResultSet.CONCUR_UPDATABLE.
If the language ResultSet is not updatable,
then getConcurrency() will return
ResultSet.CONCUR_READ_ONLY.
boolean
rowDeleted()
For forward-only result sets this method
always returns false, for scrollable result
sets it returns true if the row has been
deleted, via result set or positioned delete.
boolean
rowInserted()
Always returns false.
boolean
rowUpdated()
For forward-only result sets this method
always returns false, for scrollable result
sets it returns true if the row has been
updated, via result set or positioned
update.
void
updateRow()
After the row is updated, the ResultSet
object will be positioned before the next
row. Before issuing any methods other than
close on the ResultSet object, the program
will need to reposition the ResultSet object.
ResultSets and 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
Streamable JDBC data types
for a list
of types that support the various streams. (See also
Mapping of java.sql.Types to SQL
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 code fragment 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 a java.io.Reader to get the data
java.io.Reader ip = rs.getCharacterStream(1);
// process the stream--this is just a generic way to
// print the data
char[] buff = new char[128];
int size;
while ((size = ip.read(buff)) != -1) {
String chunk = new String(buff, 0, size);
System.out.print(chunk);