public interface StreamingStatement
extends java.sql.Statement
This interface extends Statement
to include methods for getting the statement's unique identifier,
getting rowtime bounds,
and managing millisecond-granularity statement timeouts.
Modifier and Type | Field and Description |
---|---|
static long |
TIMEOUT_NO_WAIT
Timeout interval for no-wait polling.
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes any rows in current buffers on a best effort basis.
|
long |
getQueryTimeoutMillis()
Returns the query timeout value of this statement, in milliseconds,
as set by
setQueryTimeoutMillis(long) . |
java.sql.Timestamp |
getRowtimeBound()
Returns the latest rowtime bound from the target stream.
|
long |
getStatementId()
Returns the unique identifier of this statement.
|
void |
setQueryTimeoutMillis(long millis)
Sets the query timeout of this
StreamingStatement . |
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
static final long TIMEOUT_NO_WAIT
setQueryTimeoutMillis(long)
,
Constant Field Valueslong getStatementId() throws java.sql.SQLException
java.sql.SQLException
- if the statement is not open
or statement type does not prepare a server-side statementlong getQueryTimeoutMillis() throws java.sql.SQLException
setQueryTimeoutMillis(long)
.java.sql.SQLException
- if a database access error occurssetQueryTimeoutMillis(long)
,
Statement.getQueryTimeout()
,
Statement.setQueryTimeout(int)
void setQueryTimeoutMillis(long millis) throws java.sql.SQLException
StreamingStatement
.
When a timeout t is set, the JDBC driver will wait no longer
than t milliseconds for the server to execute the statement. If
this time limit is exceeded during statement execution, the statement
throws a SQLException
. This method is like
Statement.setQueryTimeout(int)
, but with millisecond precision.
The timeout applies each time this statement is executed, by a call
to Statement.execute(java.lang.String)
, Statement.executeUpdate(java.lang.String)
, or Statement.executeQuery(java.lang.String)
.
The timeout clock starts when such a method is called and stops when it
returns: thus the timeout is a maximum time allowed to execute a DDL or
DML statement, or to wait for the ResultSet
returned by
executing a query. Note that the timeout reflects
the passage of real time, which need not be related to the rowtime of a
stream.
By default, a statement has no timeout (will wait forever); this is denoted as a timeout value 0.
When the statement is a query, execution returns a
ResultSet
, and the query timeout value becomes the fetch
timeout. This timeout affects all methods that fetch new data from
the server, such as ResultSet.next()
.
millis
- the new query timeout limit in milliseconds;
zero means there is no limit (wait forever), and
TIMEOUT_NO_WAIT
means do a no-wait polljava.sql.SQLException
- if a database access error occursgetQueryTimeoutMillis()
,
Statement.getQueryTimeout()
,
Statement.setQueryTimeout(int)
java.sql.Timestamp getRowtimeBound() throws java.sql.SQLException
For a SELECT statement or other query, the target is the stream of results. For an INSERT statement the target is the stream into which rows are being inserted. Other kinds of statements (such as DDL) have no target statement.
java.sql.SQLException
void flush() throws java.sql.SQLException
java.sql.SQLException
Copyright (C) 2003-2021 SQLstream, Inc.