public class StatementImpl extends WrapperImpl implements TeiidStatement
| Modifier and Type | Field and Description |
|---|---|
protected org.teiid.jdbc.StatementImpl.State |
commandStatus |
protected long |
currentRequestID |
protected static int |
NO_TIMEOUT |
protected Map<String,Integer> |
outParamByName |
protected Map<Integer,Integer> |
outParamIndexMap |
protected long |
queryTimeoutMS |
protected ResultSetImpl |
resultSet |
protected int[] |
updateCounts
Array of update counts as returned by executeBatch()
|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Modifier and Type | Method and Description |
|---|---|
protected void |
accumulateWarnings(List<Throwable> serverWarnings) |
void |
addBatch(String sql) |
static ResultsFuture<Boolean> |
booleanFuture(boolean isTrue) |
void |
cancel() |
protected void |
checkStatement()
This utility method checks if the jdbc statement is closed and
throws an exception if it is closed.
|
void |
clearBatch() |
void |
clearWarnings() |
void |
close() |
void |
closeOnCompletion() |
protected void |
copyPropertiesToRequest(RequestMessage res)
Helper method for copy the connection properties to request message.
|
protected RequestMessage |
createRequestMessage(String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode) |
protected void |
createResultSet(ResultsMessage resultsMsg) |
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch() |
ResultSet |
executeQuery(String sql) |
protected ResultsFuture<Boolean> |
executeSql(String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode,
boolean synch,
RequestOptions options) |
protected ResultsFuture<Boolean> |
executeSql(String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode,
boolean synch,
RequestOptions options,
boolean autoGenerateKeys) |
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
Collection<Annotation> |
getAnnotations()
Get collection of annotations from the query planner from
the last command executed on the Statement
|
ConnectionImpl |
getConnection() |
String |
getDebugLog()
Obtain the query planner debug log from the last command
executed on this Statement, if it was requested with
SHOWPLAN DEBUG.
|
protected DQP |
getDQP() |
String |
getExecutionProperty(String name)
Get the execution property value.
|
int |
getFetchDirection() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys() |
int |
getMaxFieldSize() |
int |
getMaxRows() |
protected ConnectionImpl |
getMMConnection() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
PlanNode |
getPlanDescription()
Obtain the query plan object representation from the last
command executed on this Statement, if a query plan was
requested in the command.
|
int |
getQueryTimeout() |
String |
getRequestIdentifier()
Get ID for last execution which can be used for matching up executions
on the client side with executions in the server logs.
|
ResultSetImpl |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
protected TimeZone |
getServerTimeZone() |
int |
getUpdateCount() |
SQLWarning |
getWarnings() |
protected boolean |
hasResultSet() |
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
protected void |
resetExecutionState()
Reset all per-execution state - this should be done before executing
a new command.
|
protected void |
setAnalysisInfo(ResultsMessage resultsMsg) |
void |
setCursorName(String name) |
void |
setEscapeProcessing(boolean enable) |
void |
setExecutionProperty(String name,
String value)
Set the execution property value.
|
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int maxRows) |
void |
setPayload(Serializable payload)
Set the per-statement security payload.
|
void |
setPoolable(boolean arg0) |
void |
setQueryTimeout(int seconds) |
ResultsFuture<Boolean> |
submitExecute(String sql,
RequestOptions options) |
void |
submitExecute(String sql,
StatementCallback callback,
RequestOptions options)
Execute the given statement using a non-blocking callback.
|
protected void |
timeoutOccurred()
Ends the command and sets the status to TIMED_OUT.
|
isWrapperFor, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, setLargeMaxRowsisWrapperFor, unwrapprotected static final int NO_TIMEOUT
protected volatile org.teiid.jdbc.StatementImpl.State commandStatus
protected long queryTimeoutMS
protected long currentRequestID
protected volatile ResultSetImpl resultSet
protected int[] updateCounts
protected DQP getDQP()
protected ConnectionImpl getMMConnection()
protected TimeZone getServerTimeZone() throws SQLException
SQLExceptionprotected void resetExecutionState()
throws SQLException
SQLExceptionpublic void addBatch(String sql) throws SQLException
addBatch in interface StatementSQLExceptionpublic void cancel()
throws SQLException
cancel in interface StatementSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLExceptionpublic void clearBatch()
throws SQLException
clearBatch in interface StatementSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface StatementSQLExceptionprotected void checkStatement()
throws TeiidSQLException
This utility method checks if the jdbc statement is closed and throws an exception if it is closed.
SQLException - if the statement object is closed.TeiidSQLExceptionpublic void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws SQLException
TeiidStatementsubmitExecute in interface TeiidStatementSQLExceptionpublic ResultsFuture<Boolean> submitExecute(String sql, RequestOptions options) throws SQLException
SQLExceptionpublic boolean execute(String sql) throws SQLException
execute in interface StatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLExceptionpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery in interface StatementSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate in interface StatementSQLExceptionprotected boolean hasResultSet()
throws SQLException
SQLExceptionprotected void createResultSet(ResultsMessage resultsMsg) throws SQLException
SQLExceptionprotected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode, boolean synch, RequestOptions options) throws SQLException
SQLExceptionprotected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode, boolean synch, RequestOptions options, boolean autoGenerateKeys) throws SQLException
SQLExceptionpublic static ResultsFuture<Boolean> booleanFuture(boolean isTrue)
protected RequestMessage createRequestMessage(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode)
public int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLExceptionpublic int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLExceptionpublic int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLExceptionpublic int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLExceptionpublic ResultSetImpl getResultSet() throws SQLException
getResultSet in interface StatementSQLExceptionpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLExceptionpublic int getResultSetType()
getResultSetType in interface Statementpublic int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface StatementSQLExceptionpublic void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface StatementSQLExceptionpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface StatementSQLExceptionpublic void setFetchSize(int rows)
throws SQLException
setFetchSize in interface StatementSQLExceptionpublic void setMaxRows(int maxRows)
throws SQLException
setMaxRows in interface StatementSQLExceptionpublic void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface StatementSQLExceptionprotected void copyPropertiesToRequest(RequestMessage res) throws TeiidSQLException
res - Request message that these properties to be copied to.TeiidSQLExceptionprotected void timeoutOccurred()
public void setPayload(Serializable payload)
TeiidStatementTo remove an existing payload from a statement, call this method
with a null argument.
setPayload in interface TeiidStatementpayload - The payload that is to accompany requests executed
from this statement.public void setExecutionProperty(String name, String value)
TeiidStatementsetExecutionProperty in interface TeiidStatementname - Execution property namevalue - Execution property valuepublic String getExecutionProperty(String name)
TeiidStatementgetExecutionProperty in interface TeiidStatementname - Execution property namepublic PlanNode getPlanDescription()
TeiidStatementgetPlanDescription in interface TeiidStatementpublic String getDebugLog()
TeiidStatementgetDebugLog in interface TeiidStatementpublic Collection<Annotation> getAnnotations()
TeiidStatementgetAnnotations in interface TeiidStatementAnnotations, may return nullpublic String getRequestIdentifier()
TeiidStatementgetRequestIdentifier in interface TeiidStatementprotected void setAnalysisInfo(ResultsMessage resultsMsg)
public boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic void setPoolable(boolean arg0)
throws SQLException
setPoolable in interface StatementSQLExceptionpublic ConnectionImpl getConnection() throws SQLException
getConnection in interface StatementSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute in interface StatementSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute in interface StatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate in interface StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys in interface StatementSQLExceptionpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
setCursorName in interface StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface StatementSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion in interface StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion in interface StatementSQLExceptionCopyright © 2019. All rights reserved.