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, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, setLargeMaxRows
isWrapperFor, unwrap
protected 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
SQLException
protected void resetExecutionState() throws SQLException
SQLException
public void addBatch(String sql) throws SQLException
addBatch
in interface Statement
SQLException
public void cancel() throws SQLException
cancel
in interface Statement
SQLException
public void clearWarnings() throws SQLException
clearWarnings
in interface Statement
SQLException
public void clearBatch() throws SQLException
clearBatch
in interface Statement
SQLException
public void close() throws SQLException
close
in interface AutoCloseable
close
in interface Statement
SQLException
protected 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.TeiidSQLException
public void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws SQLException
TeiidStatement
submitExecute
in interface TeiidStatement
SQLException
public ResultsFuture<Boolean> submitExecute(String sql, RequestOptions options) throws SQLException
SQLException
public boolean execute(String sql) throws SQLException
execute
in interface Statement
SQLException
public int[] executeBatch() throws SQLException
executeBatch
in interface Statement
SQLException
public ResultSet executeQuery(String sql) throws SQLException
executeQuery
in interface Statement
SQLException
public int executeUpdate(String sql) throws SQLException
executeUpdate
in interface Statement
SQLException
protected boolean hasResultSet() throws SQLException
SQLException
protected void createResultSet(ResultsMessage resultsMsg) throws SQLException
SQLException
protected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode, boolean synch, RequestOptions options) throws SQLException
SQLException
protected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode, boolean synch, RequestOptions options, boolean autoGenerateKeys) throws SQLException
SQLException
public static ResultsFuture<Boolean> booleanFuture(boolean isTrue)
protected RequestMessage createRequestMessage(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode)
public int getFetchDirection() throws SQLException
getFetchDirection
in interface Statement
SQLException
public int getFetchSize() throws SQLException
getFetchSize
in interface Statement
SQLException
public int getMaxFieldSize() throws SQLException
getMaxFieldSize
in interface Statement
SQLException
public int getMaxRows() throws SQLException
getMaxRows
in interface Statement
SQLException
public boolean getMoreResults() throws SQLException
getMoreResults
in interface Statement
SQLException
public boolean getMoreResults(int current) throws SQLException
getMoreResults
in interface Statement
SQLException
public int getQueryTimeout() throws SQLException
getQueryTimeout
in interface Statement
SQLException
public ResultSetImpl getResultSet() throws SQLException
getResultSet
in interface Statement
SQLException
public int getResultSetConcurrency() throws SQLException
getResultSetConcurrency
in interface Statement
SQLException
public int getResultSetType()
getResultSetType
in interface Statement
public int getUpdateCount() throws SQLException
getUpdateCount
in interface Statement
SQLException
public SQLWarning getWarnings() throws SQLException
getWarnings
in interface Statement
SQLException
public void setEscapeProcessing(boolean enable) throws SQLException
setEscapeProcessing
in interface Statement
SQLException
public void setFetchDirection(int direction) throws SQLException
setFetchDirection
in interface Statement
SQLException
public void setFetchSize(int rows) throws SQLException
setFetchSize
in interface Statement
SQLException
public void setMaxRows(int maxRows) throws SQLException
setMaxRows
in interface Statement
SQLException
public void setQueryTimeout(int seconds) throws SQLException
setQueryTimeout
in interface Statement
SQLException
protected void copyPropertiesToRequest(RequestMessage res) throws TeiidSQLException
res
- Request message that these properties to be copied to.TeiidSQLException
protected void timeoutOccurred()
public void setPayload(Serializable payload)
TeiidStatement
To remove an existing payload from a statement, call this method
with a null
argument.
setPayload
in interface TeiidStatement
payload
- The payload that is to accompany requests executed
from this statement.public void setExecutionProperty(String name, String value)
TeiidStatement
setExecutionProperty
in interface TeiidStatement
name
- Execution property namevalue
- Execution property valuepublic String getExecutionProperty(String name)
TeiidStatement
getExecutionProperty
in interface TeiidStatement
name
- Execution property namepublic PlanNode getPlanDescription()
TeiidStatement
getPlanDescription
in interface TeiidStatement
public String getDebugLog()
TeiidStatement
getDebugLog
in interface TeiidStatement
public Collection<Annotation> getAnnotations()
TeiidStatement
getAnnotations
in interface TeiidStatement
Annotation
s, may return nullpublic String getRequestIdentifier()
TeiidStatement
getRequestIdentifier
in interface TeiidStatement
protected void setAnalysisInfo(ResultsMessage resultsMsg)
public boolean isPoolable() throws SQLException
isPoolable
in interface Statement
SQLException
public void setPoolable(boolean arg0) throws SQLException
setPoolable
in interface Statement
SQLException
public ConnectionImpl getConnection() throws SQLException
getConnection
in interface Statement
SQLException
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute
in interface Statement
SQLException
public boolean execute(String sql, int[] columnIndexes) throws SQLException
execute
in interface Statement
SQLException
public boolean execute(String sql, String[] columnNames) throws SQLException
execute
in interface Statement
SQLException
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate
in interface Statement
SQLException
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate
in interface Statement
SQLException
public int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate
in interface Statement
SQLException
public ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys
in interface Statement
SQLException
public int getResultSetHoldability() throws SQLException
getResultSetHoldability
in interface Statement
SQLException
public void setCursorName(String name) throws SQLException
setCursorName
in interface Statement
SQLException
public void setMaxFieldSize(int max) throws SQLException
setMaxFieldSize
in interface Statement
SQLException
public void closeOnCompletion() throws SQLException
closeOnCompletion
in interface Statement
SQLException
public boolean isCloseOnCompletion() throws SQLException
isCloseOnCompletion
in interface Statement
SQLException
Copyright © 2019. All rights reserved.