StreamingResultSet
The Streaming ResultSet interface provides extends the standard ResultSet interface to include information on the next incoming row or rowtime bound. (See http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html) Knowledge of the next incoming row is crucial for streaming SQL because this lets you tell the system to “wait” for the next row. You should CAST ResultSet to Streaming ResultSet in order to use the functions below.
Nested Class Summary
Modifier and Type |
Interface and Description |
static class |
StreamingResultSet.RowEvent |
Method Summary
Modifier and Type |
Method and Description |
Timestamp |
getRowtimeBound()Returns the latest rowtime bound from the target stream. |
StreamingResultSet.RowEvent |
nextRowOrRowtime()Extension to ResultSet.next that returns when the next row or new rowtime bound arrives. Returns row, rowtime bound, or timeout. |
StreamingResultSet.RowEvent |
nextRowOrRowtime(long timeout)Extension to ResultSet.next that returns when the next row or new rowtime bound arrives. |
Method Detail
Method |
Detail |
nextRowOrRowtime |
StreamingResultSet.RowEvent nextRowOrRowtime()throws SQLExceptionExtension to ResultSet.next that returns when the next row or new rowtime bound arrives.Returns:RowEvent indicating whether row or rowtime bound has arrived. If NewRow is returned, then JDBC fields will be set as in ResultSet.next.Throws:SQLException |
getRowtimeBound |
Timestamp getRowtimeBound()throws SQLExceptionReturns the latest rowtime bound from the target stream. This is a lower bound on the rowtime of the next row to arrive on the stream.Returns:rowtime bound (UTC)Throws:SQLException |
StreamingResultSet.RowEvent
Method Summary
Methods
Modifier and Type |
Method and Description |
static StreamingResultSet.RowEvent |
valueOf(String name)Returns the enum constant of this type with the specified name. |
staticStreamingResultSet.RowEvent[] |
values()Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
Enum Constant Detail
Constant |
Detail |
EndOfStream |
public static final StreamingResultSet.RowEvent EndOfStream |
NewRow |
public static final StreamingResultSet.RowEvent NewRow |
NewRowtimeBound |
public static final StreamingResultSet.RowEvent NewRowtimeBound |
Timeout |
public static final StreamingResultSet.RowEvent Timeout |
Method Detail
Method |
Detail |
values |
public static StreamingResultSet.RowEvent[] values()Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: for (StreamingResultSet.RowEvent c : StreamingResultSet.RowEvent.values()) System.out.println(c);Returns: an array containing the constants of this enum type, in the order they are declared |
valueOf |
valueOfpublic static StreamingResultSet.RowEvent valueOf(String name)Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)Parameters:name - the name of the enum constant to be returned.Returns:the enum constant with the specified name.Throws:IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null |