|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.jdbc.WrapperImpl
org.teiid.jdbc.StatementImpl
public class StatementImpl
Field Summary | |
---|---|
protected static int |
CANCELLED
|
protected int |
commandStatus
|
protected long |
currentRequestID
|
protected static int |
NO_TIMEOUT
|
protected java.util.Map |
outParamIndexMap
|
protected int |
queryTimeout
|
protected ResultSetImpl |
resultSet
|
protected static int |
TIMED_OUT
|
protected int[] |
updateCounts
Array of update counts as returned by executeBatch() |
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 | |
---|---|
protected void |
accumulateWarnings(java.util.List<java.lang.Exception> serverWarnings)
|
void |
addBatch(java.lang.String sql)
Adds sql to this statement object's current list of commands. |
void |
cancel()
This method can be used by one thread to cancel a statement that is being executed by another thread. |
protected void |
cancelRequest()
|
protected void |
checkStatement()
This utility method checks if the jdbc statement is closed and throws an exception if it is closed. |
void |
clearBatch()
Makes the set of commands in the current batch empty. |
void |
clearWarnings()
Warning could be schema validation errors or partial results warnings. |
void |
close()
In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release. |
protected void |
copyPropertiesToRequest(RequestMessage res)
Helper method for copy the connection properties to request message. |
protected RequestMessage |
createRequestMessage(java.lang.String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode)
|
protected void |
createResultSet(ResultsMessage resultsMsg)
|
boolean |
execute(java.lang.String sql)
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
|
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
|
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
|
int[] |
executeBatch()
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
|
protected void |
executeSql(java.lang.String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode)
|
int |
executeUpdate(java.lang.String sql)
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
|
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
|
java.util.Collection<Annotation> |
getAnnotations()
Get annotations |
ConnectionImpl |
getConnection()
|
java.lang.String |
getDebugLog()
Get query planner debug log. |
protected DQP |
getDQP()
|
java.lang.String |
getExecutionProperty(java.lang.String name)
Get the execution property value. |
int |
getFetchDirection()
Retreives the fetch direction this Statement object set as a performance hint to the driver. |
int |
getFetchSize()
Retreives the fetch size this Statement object set as a performance hint to the driver. |
java.sql.ResultSet |
getGeneratedKeys()
|
int |
getMaxFieldSize()
Retreives the maximum number of bytes that a result set column may contain. |
int |
getMaxRows()
Retrives the maximum number of rows that a ResultSet object may contain. |
protected ConnectionImpl |
getMMConnection()
|
boolean |
getMoreResults()
Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method #getResultSet. |
boolean |
getMoreResults(int current)
Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object. |
PlanNode |
getPlanDescription()
Get Query plan description. |
int |
getQueryTimeout()
Return the number of seconds the driver will wait for a statement object to execute |
java.lang.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. |
java.sql.ResultSet |
getResultSet()
Returns a ResultSet object that was produced by a call to the method execute. |
int |
getResultSetConcurrency()
Retrieves the concurrency mode for the ResultSet objects generated from queries that this Statement object executes. |
int |
getResultSetHoldability()
|
int |
getResultSetType()
Retrieves the type of the ResultSet objects generated from queries that this statement executes. |
protected java.util.TimeZone |
getServerTimeZone()
|
int |
getUpdateCount()
This method returns the number of rows affected by a statement modifying a table. |
java.sql.SQLWarning |
getWarnings()
This method returns warnings returned by server. |
protected boolean |
hasResultSet()
|
boolean |
isClosed()
Check is the statement is closed. |
boolean |
isPoolable()
|
protected void |
resetExecutionState()
Reset all per-execution state - this should be done before executing a new command. |
protected ResultsMessage |
sendRequestMessageAndWait(RequestMessage reqMsg)
Send out request message with necessary states. |
protected void |
setAnalysisInfo(ResultsMessage resultsMsg)
|
void |
setCursorName(java.lang.String name)
|
void |
setEscapeProcessing(boolean enable)
This method enbles/disables escape processing. |
void |
setExecutionProperty(java.lang.String name,
java.lang.String value)
Set the execution property value. |
void |
setFetchDirection(int direction)
|
void |
setFetchSize(int rows)
|
void |
setMaxFieldSize(int max)
|
void |
setMaxRows(int maxRows)
Sets the limit on the maximum number of rows in a ResultSet object. |
void |
setPayload(java.io.Serializable payload)
Set the per-statement security payload. |
void |
setPoolable(boolean arg0)
|
void |
setQueryTimeout(int seconds)
This sets to seconds the time limit for the number of seconds for a driver to wait for a statement object to be executed. |
protected void |
timeoutOccurred()
Ends the command and sets the status to TIMED_OUT. |
Methods inherited from class org.teiid.jdbc.WrapperImpl |
---|
isWrapperFor, unwrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Field Detail |
---|
protected static final int TIMED_OUT
protected static final int CANCELLED
protected static final int NO_TIMEOUT
protected int commandStatus
protected int queryTimeout
protected long currentRequestID
protected ResultSetImpl resultSet
protected int[] updateCounts
protected java.util.Map outParamIndexMap
Method Detail |
---|
protected DQP getDQP()
protected ConnectionImpl getMMConnection()
protected java.util.TimeZone getServerTimeZone() throws java.sql.SQLException
java.sql.SQLException
protected void resetExecutionState() throws java.sql.SQLException
java.sql.SQLException
public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
sql
- statement to be added to the batch
java.sql.SQLException
public void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
- should never occur.public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
- should never occur.public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
- if a database access error occurs or the
driver does not support batch statementspublic void close() throws java.sql.SQLException
close
in interface java.sql.Statement
java.sql.SQLException
- should never occur.protected void checkStatement() throws TeiidSQLException
This utility method checks if the jdbc statement is closed and throws an exception if it is closed.
java.sql.SQLException
- if the statement object is closed.
TeiidSQLException
public boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
protected boolean hasResultSet() throws java.sql.SQLException
java.sql.SQLException
protected void createResultSet(ResultsMessage resultsMsg) throws java.sql.SQLException
java.sql.SQLException
protected void executeSql(java.lang.String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode) throws java.sql.SQLException
java.sql.SQLException
protected RequestMessage createRequestMessage(java.lang.String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode)
public int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- should never occur.public int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
- should never occur.public int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- should never occur.public int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
- should never iccure.public boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- if there is an error in database.public boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
current
- flag that gives instruction on what should happen
to current ResultSet objects obtained using the method getResultSet(
CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS).
java.sql.SQLException
- if there is an error in database.public int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- should never occurpublic java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
- should never occurpublic int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
- should never occurpublic int getResultSetType()
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
- should never occurpublic int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
- should never occurprotected void accumulateWarnings(java.util.List<java.lang.Exception> serverWarnings)
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
- should never occurpublic void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
enable
- boolean value indicating if the escape processing should be turned on
java.sql.SQLException
- should never occurpublic void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
java.sql.SQLException
public void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
java.sql.SQLException
public void setMaxRows(int maxRows) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
maxRows
- int value indicating maximum rows that can be returned in a ResultSet
java.sql.SQLException
public void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
seconds
- Maximum number of seconds for a statement object to execute.
throws SQLException, should never occur
java.sql.SQLException
protected void copyPropertiesToRequest(RequestMessage res) throws TeiidSQLException
res
- Request message that these properties to be copied to.
TeiidSQLException
protected void timeoutOccurred()
protected void cancelRequest() throws java.sql.SQLException
java.sql.SQLException
public void setPayload(java.io.Serializable payload)
null
, a new payload is set on
the statement or the statement is closed.
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(java.lang.String name, java.lang.String value)
TeiidStatement
setExecutionProperty
in interface TeiidStatement
name
- Execution property namevalue
- Execution property valuepublic java.lang.String getExecutionProperty(java.lang.String name)
TeiidStatement
getExecutionProperty
in interface TeiidStatement
name
- Execution property name
protected ResultsMessage sendRequestMessageAndWait(RequestMessage reqMsg) throws java.sql.SQLException, java.lang.InterruptedException
java.sql.SQLException
java.lang.InterruptedException
public PlanNode getPlanDescription()
getPlanDescription
in interface TeiidStatement
public java.lang.String getDebugLog()
getDebugLog
in interface TeiidStatement
public java.util.Collection<Annotation> getAnnotations()
getAnnotations
in interface TeiidStatement
public java.lang.String getRequestIdentifier()
TeiidStatement
getRequestIdentifier
in interface TeiidStatement
public boolean isClosed()
isClosed
in interface java.sql.Statement
protected void setAnalysisInfo(ResultsMessage resultsMsg)
public boolean isPoolable() throws java.sql.SQLException
isPoolable
in interface java.sql.Statement
java.sql.SQLException
public void setPoolable(boolean arg0) throws java.sql.SQLException
setPoolable
in interface java.sql.Statement
java.sql.SQLException
public ConnectionImpl getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
public void setCursorName(java.lang.String name) throws java.sql.SQLException
setCursorName
in interface java.sql.Statement
java.sql.SQLException
public void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |