StreamingPreparedStatement

Every PreparedStatement created by the SQLstream JDBC driver implements the StreamingPreparedStatement interface. The following code shows the setRowtimeBound method. java

interface StreamingPreparedStatement extends
              java.sql.PreparedStatement, StreamingStatement {
   void setRowtimeBound(Timestamp bound)
;
}

However, the setRowtimeBound method is only meaningful for INSERT EXPEDITED prepared statements. A SQLException is thrown if setRowtimeBound is called on other prepared queries. Example usages:

long nextRowDelay = 5000L;
pstmt.setRowtimeBound(new Timestamp(System.currentTimeMillis() +
nextRowDelay))
or
long nextRowDelay = 5000L;
java.sql.Timestamp ts = <some retrieved value>
pstmt.setRowtimeBound(new Timestamp(ts.getTime() + nextRowDelay));

setRowtimeBound(Timestamp bound) sets a rowtime bound, which has a single attribute, a timestamp.

Interface Summary

public interface StreamingPreparedStatement extends PreparedStatement, StreamingStatement Aspen streaming prepared statement interface. This interface extends PreparedStatement and StreamingStatement to include methods for sending rowtime bounds.

Field Summary

Fields inherited from interface com.sqlstream.jdbc.StreamingStatement TIMEOUT_NO_WAIT

Fields inherited from interface java.sql.Statement CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO

Method Summary

Modifier and Type Method and Description
void setRowtimeBound(Timestamp bound)
Sets the rowtime bound for the current stream.

Sets the rowtime bound for the current stream.

Method Detail

Method Detail
setRowtimeBound void setRowtimeBound(Timestamp bound)

                    throws SQLException Sets the rowtime bound for the current stream. The caller thereby indicates that no more tuples will be written to the stream until the UTC time specified by bound. Parameters: bound - earliest time (UTC) at which next tuple will be written Throws: SQLException | |                   Calendar cal)                     throws SQLException Sets the rowtime bound for the current stream. The caller thereby indicates that no more tuples will be written to the stream until the time specified by bound and cal. Implementation note: cal is currently ignored and this method behaves exactly as setRowtimeBound(Timestamp). Parameters: bound - earliest time at which next tuple will be written cal - Calendar context for the bound Timestamp Throws: SQLException