public class PreparedStatementImpl extends StatementImpl implements TeiidPreparedStatement
Instances of PreparedStatement contain a SQL statement that has already been compiled. The SQL statement contained in a PreparedStatement object may have one or more IN parameters. An IN parameter is a parameter whose value is not specified when a SQL statement is created. Instead the statement has a placeholder for each IN parameter.
The MMPreparedStatement object wraps the server's PreparedStatement object. The methods in this class are used to set the IN parameters on a server's preparedstatement object.
Modifier and Type | Field and Description |
---|---|
protected List<List<Object>> |
batchParameterList |
protected String |
prepareSql |
commandStatus, currentRequestID, NO_TIMEOUT, outParamByName, outParamIndexMap, queryTimeoutMS, resultSet, updateCounts
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 |
---|---|
void |
addBatch()
Adds a set of parameters to this PreparedStatement object's list of commands
to be sent to the database for execution as a batch.
|
void |
addBatch(String sql) |
void |
clearBatch()
Makes the set of commands in the current batch empty.
|
void |
clearParameters()
Clears the values set for the PreparedStatement object's IN parameters and
releases the resources used by those values.
|
protected RequestMessage |
createRequestMessage(String[] commands,
boolean isBatchedCommand,
RequestMessage.ResultsMode resultsMode) |
boolean |
execute() |
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch() |
ResultSetImpl |
executeQuery() |
ResultSet |
executeQuery(String sql) |
int |
executeUpdate() |
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
ResultSetMetaData |
getMetaData() |
ParameterMetaDataImpl |
getParameterMetaData() |
void |
setArray(int parameterIndex,
Array x) |
void |
setAsciiStream(int parameterIndex,
InputStream x) |
void |
setAsciiStream(int parameterIndex,
InputStream in,
int length) |
void |
setAsciiStream(int parameterIndex,
InputStream x,
long length) |
void |
setAutoGeneratedKeys(boolean getAutoGeneratedKeys) |
void |
setBigDecimal(int parameterIndex,
BigDecimal value) |
void |
setBinaryStream(int parameterIndex,
InputStream x) |
void |
setBinaryStream(int parameterIndex,
InputStream in,
int length) |
void |
setBinaryStream(int parameterIndex,
InputStream x,
long length) |
void |
setBlob(int parameterIndex,
Blob x) |
void |
setBlob(int parameterIndex,
InputStream inputStream) |
void |
setBlob(int parameterIndex,
InputStream inputStream,
long length) |
void |
setBoolean(int parameterIndex,
boolean value) |
void |
setByte(int parameterIndex,
byte value) |
void |
setBytes(int parameterIndex,
byte[] bytes) |
void |
setCharacterStream(int parameterIndex,
Reader reader) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
int length) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
long length) |
void |
setClob(int parameterIndex,
Clob x) |
void |
setClob(int parameterIndex,
Reader reader) |
void |
setClob(int parameterIndex,
Reader reader,
long length) |
void |
setCommand(Object command) |
void |
setDate(int parameterIndex,
Date value) |
void |
setDate(int parameterIndex,
Date x,
Calendar cal) |
void |
setDouble(int parameterIndex,
double value) |
void |
setFloat(int parameterIndex,
float value) |
void |
setInt(int parameterIndex,
int value) |
void |
setLong(int parameterIndex,
long value) |
void |
setNCharacterStream(int parameterIndex,
Reader value) |
void |
setNCharacterStream(int parameterIndex,
Reader value,
long length) |
void |
setNClob(int parameterIndex,
NClob value) |
void |
setNClob(int parameterIndex,
Reader reader) |
void |
setNClob(int parameterIndex,
Reader reader,
long length) |
void |
setNString(int parameterIndex,
String value) |
void |
setNull(int parameterIndex,
int jdbcType) |
void |
setNull(int parameterIndex,
int jdbcType,
String typeName) |
void |
setObject(int parameterIndex,
Object value) |
void |
setObject(int parameterIndex,
Object value,
int targetJdbcType) |
void |
setObject(int parameterIndex,
Object value,
int targetJdbcType,
int scale) |
void |
setRef(int parameterIndex,
Ref x) |
void |
setRowId(int parameterIndex,
RowId x) |
void |
setShort(int parameterIndex,
short value) |
void |
setSQLXML(int parameterIndex,
SQLXML xmlObject) |
void |
setString(int parameterIndex,
String value) |
void |
setTime(int parameterIndex,
Time value) |
void |
setTime(int parameterIndex,
Time x,
Calendar cal) |
void |
setTimestamp(int parameterIndex,
Timestamp value) |
void |
setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal) |
void |
setUnicodeStream(int parameterIndex,
InputStream x,
int length) |
void |
setURL(int parameterIndex,
URL x) |
ResultsFuture<Boolean> |
submitExecute(RequestMessage.ResultsMode mode,
RequestOptions options) |
void |
submitExecute(StatementCallback callback,
RequestOptions options)
Execute the given statement using a non-blocking callback.
|
void |
submitExecute(String sql,
StatementCallback callback,
RequestOptions options)
Execute the given statement using a non-blocking callback.
|
accumulateWarnings, booleanFuture, cancel, checkStatement, clearWarnings, close, closeOnCompletion, copyPropertiesToRequest, createResultSet, executeSql, executeSql, getAnnotations, getConnection, getDebugLog, getDQP, getExecutionProperty, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMMConnection, getMoreResults, getMoreResults, getPlanDescription, getQueryTimeout, getRequestIdentifier, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getServerTimeZone, getUpdateCount, getWarnings, hasResultSet, isClosed, isCloseOnCompletion, isPoolable, resetExecutionState, setAnalysisInfo, setCursorName, setEscapeProcessing, setExecutionProperty, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPayload, setPoolable, setQueryTimeout, submitExecute, timeoutOccurred
isWrapperFor, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeLargeUpdate, setObject, setObject
cancel, clearWarnings, close, closeOnCompletion, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, 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
isWrapperFor, unwrap
protected String prepareSql
public void setAutoGeneratedKeys(boolean getAutoGeneratedKeys)
public void addBatch() throws SQLException
Adds a set of parameters to this PreparedStatement object's list of commands to be sent to the database for execution as a batch.
addBatch
in interface PreparedStatement
SQLException
- if there is an errorpublic void clearBatch() throws SQLException
clearBatch
in interface Statement
clearBatch
in class StatementImpl
SQLException
- if a database access error occurs or the
driver does not support batch statementspublic void clearParameters() throws SQLException
Clears the values set for the PreparedStatement object's IN parameters and releases the resources used by those values. In general, parameter values remain in force for repeated use of statement.
clearParameters
in interface PreparedStatement
SQLException
- if there is an error while clearing paramspublic boolean execute(String sql) throws SQLException
execute
in interface Statement
execute
in class StatementImpl
SQLException
public void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws TeiidSQLException
TeiidStatement
submitExecute
in interface TeiidStatement
submitExecute
in class StatementImpl
TeiidSQLException
public ResultSet executeQuery(String sql) throws SQLException
executeQuery
in interface Statement
executeQuery
in class StatementImpl
SQLException
public int executeUpdate(String sql) throws SQLException
executeUpdate
in interface Statement
executeUpdate
in class StatementImpl
SQLException
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute
in interface Statement
execute
in class StatementImpl
SQLException
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate
in interface Statement
executeUpdate
in class StatementImpl
SQLException
public boolean execute(String sql, int[] columnIndexes) throws SQLException
execute
in interface Statement
execute
in class StatementImpl
SQLException
public boolean execute(String sql, String[] columnNames) throws SQLException
execute
in interface Statement
execute
in class StatementImpl
SQLException
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate
in interface Statement
executeUpdate
in class StatementImpl
SQLException
public int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate
in interface Statement
executeUpdate
in class StatementImpl
SQLException
public void addBatch(String sql) throws SQLException
addBatch
in interface Statement
addBatch
in class StatementImpl
SQLException
public void submitExecute(StatementCallback callback, RequestOptions options) throws SQLException
TeiidPreparedStatement
submitExecute
in interface TeiidPreparedStatement
SQLException
public ResultsFuture<Boolean> submitExecute(RequestMessage.ResultsMode mode, RequestOptions options) throws SQLException
SQLException
public boolean execute() throws SQLException
execute
in interface PreparedStatement
SQLException
public int[] executeBatch() throws SQLException
executeBatch
in interface Statement
executeBatch
in class StatementImpl
SQLException
public ResultSetImpl executeQuery() throws SQLException
executeQuery
in interface PreparedStatement
SQLException
public int executeUpdate() throws SQLException
executeUpdate
in interface PreparedStatement
SQLException
protected RequestMessage createRequestMessage(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode)
createRequestMessage
in class StatementImpl
public ResultSetMetaData getMetaData() throws SQLException
getMetaData
in interface PreparedStatement
SQLException
public void setAsciiStream(int parameterIndex, InputStream in, int length) throws SQLException
setAsciiStream
in interface PreparedStatement
SQLException
public void setBigDecimal(int parameterIndex, BigDecimal value) throws SQLException
setBigDecimal
in interface PreparedStatement
SQLException
public void setBinaryStream(int parameterIndex, InputStream in, int length) throws SQLException
setBinaryStream
in interface PreparedStatement
SQLException
public void setBlob(int parameterIndex, Blob x) throws SQLException
setBlob
in interface PreparedStatement
SQLException
public void setBoolean(int parameterIndex, boolean value) throws SQLException
setBoolean
in interface PreparedStatement
SQLException
public void setByte(int parameterIndex, byte value) throws SQLException
setByte
in interface PreparedStatement
SQLException
public void setBytes(int parameterIndex, byte[] bytes) throws SQLException
setBytes
in interface PreparedStatement
SQLException
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
setCharacterStream
in interface PreparedStatement
SQLException
public void setClob(int parameterIndex, Clob x) throws SQLException
setClob
in interface PreparedStatement
SQLException
public void setDate(int parameterIndex, Date value) throws SQLException
setDate
in interface PreparedStatement
SQLException
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
setDate
in interface PreparedStatement
SQLException
public void setDouble(int parameterIndex, double value) throws SQLException
setDouble
in interface PreparedStatement
SQLException
public void setFloat(int parameterIndex, float value) throws SQLException
setFloat
in interface PreparedStatement
SQLException
public void setInt(int parameterIndex, int value) throws SQLException
setInt
in interface PreparedStatement
SQLException
public void setLong(int parameterIndex, long value) throws SQLException
setLong
in interface PreparedStatement
SQLException
public void setNull(int parameterIndex, int jdbcType) throws SQLException
setNull
in interface PreparedStatement
SQLException
public void setNull(int parameterIndex, int jdbcType, String typeName) throws SQLException
setNull
in interface PreparedStatement
SQLException
public void setObject(int parameterIndex, Object value, int targetJdbcType, int scale) throws SQLException
setObject
in interface PreparedStatement
SQLException
public void setObject(int parameterIndex, Object value, int targetJdbcType) throws SQLException
setObject
in interface PreparedStatement
SQLException
public void setObject(int parameterIndex, Object value) throws SQLException
setObject
in interface PreparedStatement
SQLException
public void setShort(int parameterIndex, short value) throws SQLException
setShort
in interface PreparedStatement
SQLException
public void setString(int parameterIndex, String value) throws SQLException
setString
in interface PreparedStatement
SQLException
public void setTime(int parameterIndex, Time value) throws SQLException
setTime
in interface PreparedStatement
SQLException
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException
setTime
in interface PreparedStatement
SQLException
public void setTimestamp(int parameterIndex, Timestamp value) throws SQLException
setTimestamp
in interface PreparedStatement
SQLException
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
setTimestamp
in interface PreparedStatement
SQLException
public void setURL(int parameterIndex, URL x) throws SQLException
setURL
in interface PreparedStatement
SQLException
public ParameterMetaDataImpl getParameterMetaData() throws SQLException
getParameterMetaData
in interface PreparedStatement
SQLException
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
setSQLXML
in interface PreparedStatement
SQLException
public void setArray(int parameterIndex, Array x) throws SQLException
setArray
in interface PreparedStatement
SQLException
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
setAsciiStream
in interface PreparedStatement
SQLException
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
setAsciiStream
in interface PreparedStatement
SQLException
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
setBinaryStream
in interface PreparedStatement
SQLException
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
setBinaryStream
in interface PreparedStatement
SQLException
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
setBlob
in interface PreparedStatement
SQLException
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
setBlob
in interface PreparedStatement
SQLException
public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
setCharacterStream
in interface PreparedStatement
SQLException
public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
setCharacterStream
in interface PreparedStatement
SQLException
public void setClob(int parameterIndex, Reader reader) throws SQLException
setClob
in interface PreparedStatement
SQLException
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
setClob
in interface PreparedStatement
SQLException
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
setNCharacterStream
in interface PreparedStatement
SQLException
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
setNCharacterStream
in interface PreparedStatement
SQLException
public void setNClob(int parameterIndex, NClob value) throws SQLException
setNClob
in interface PreparedStatement
SQLException
public void setNClob(int parameterIndex, Reader reader) throws SQLException
setNClob
in interface PreparedStatement
SQLException
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
setNClob
in interface PreparedStatement
SQLException
public void setNString(int parameterIndex, String value) throws SQLException
setNString
in interface PreparedStatement
SQLException
public void setRef(int parameterIndex, Ref x) throws SQLException
setRef
in interface PreparedStatement
SQLException
public void setRowId(int parameterIndex, RowId x) throws SQLException
setRowId
in interface PreparedStatement
SQLException
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
setUnicodeStream
in interface PreparedStatement
SQLException
public void setCommand(Object command)
Copyright © 2018 JBoss by Red Hat. All rights reserved.