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, updateCountsCLOSE_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, timeoutOccurredisWrapperFor, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteLargeUpdate, setObject, setObjectcancel, 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, setQueryTimeoutisWrapperFor, unwrapprotected 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 PreparedStatementSQLException - if there is an errorpublic void clearBatch()
throws SQLException
clearBatch in interface StatementclearBatch in class StatementImplSQLException - 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 PreparedStatementSQLException - if there is an error while clearing paramspublic boolean execute(String sql) throws SQLException
execute in interface Statementexecute in class StatementImplSQLExceptionpublic void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws TeiidSQLException
TeiidStatementsubmitExecute in interface TeiidStatementsubmitExecute in class StatementImplTeiidSQLExceptionpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery in interface StatementexecuteQuery in class StatementImplSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate in interface StatementexecuteUpdate in class StatementImplSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute in interface Statementexecute in class StatementImplSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate in interface StatementexecuteUpdate in class StatementImplSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute in interface Statementexecute in class StatementImplSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute in interface Statementexecute in class StatementImplSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate in interface StatementexecuteUpdate in class StatementImplSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate in interface StatementexecuteUpdate in class StatementImplSQLExceptionpublic void addBatch(String sql) throws SQLException
addBatch in interface StatementaddBatch in class StatementImplSQLExceptionpublic void submitExecute(StatementCallback callback, RequestOptions options) throws SQLException
TeiidPreparedStatementsubmitExecute in interface TeiidPreparedStatementSQLExceptionpublic ResultsFuture<Boolean> submitExecute(RequestMessage.ResultsMode mode, RequestOptions options) throws SQLException
SQLExceptionpublic boolean execute()
throws SQLException
execute in interface PreparedStatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch in interface StatementexecuteBatch in class StatementImplSQLExceptionpublic ResultSetImpl executeQuery() throws SQLException
executeQuery in interface PreparedStatementSQLExceptionpublic int executeUpdate()
throws SQLException
executeUpdate in interface PreparedStatementSQLExceptionprotected RequestMessage createRequestMessage(String[] commands, boolean isBatchedCommand, RequestMessage.ResultsMode resultsMode)
createRequestMessage in class StatementImplpublic ResultSetMetaData getMetaData() throws SQLException
getMetaData in interface PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream in,
int length)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setBigDecimal(int parameterIndex,
BigDecimal value)
throws SQLException
setBigDecimal in interface PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream in,
int length)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
Blob x)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setBoolean(int parameterIndex,
boolean value)
throws SQLException
setBoolean in interface PreparedStatementSQLExceptionpublic void setByte(int parameterIndex,
byte value)
throws SQLException
setByte in interface PreparedStatementSQLExceptionpublic void setBytes(int parameterIndex,
byte[] bytes)
throws SQLException
setBytes in interface PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
int length)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Clob x)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date value)
throws SQLException
setDate in interface PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date x,
Calendar cal)
throws SQLException
setDate in interface PreparedStatementSQLExceptionpublic void setDouble(int parameterIndex,
double value)
throws SQLException
setDouble in interface PreparedStatementSQLExceptionpublic void setFloat(int parameterIndex,
float value)
throws SQLException
setFloat in interface PreparedStatementSQLExceptionpublic void setInt(int parameterIndex,
int value)
throws SQLException
setInt in interface PreparedStatementSQLExceptionpublic void setLong(int parameterIndex,
long value)
throws SQLException
setLong in interface PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int jdbcType)
throws SQLException
setNull in interface PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int jdbcType,
String typeName)
throws SQLException
setNull in interface PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object value,
int targetJdbcType,
int scale)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object value,
int targetJdbcType)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object value)
throws SQLException
setObject in interface PreparedStatementSQLExceptionpublic void setShort(int parameterIndex,
short value)
throws SQLException
setShort in interface PreparedStatementSQLExceptionpublic void setString(int parameterIndex,
String value)
throws SQLException
setString in interface PreparedStatementSQLExceptionpublic void setTime(int parameterIndex,
Time value)
throws SQLException
setTime in interface PreparedStatementSQLExceptionpublic void setTime(int parameterIndex,
Time x,
Calendar cal)
throws SQLException
setTime in interface PreparedStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp value)
throws SQLException
setTimestamp in interface PreparedStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
setTimestamp in interface PreparedStatementSQLExceptionpublic void setURL(int parameterIndex,
URL x)
throws SQLException
setURL in interface PreparedStatementSQLExceptionpublic ParameterMetaDataImpl getParameterMetaData() throws SQLException
getParameterMetaData in interface PreparedStatementSQLExceptionpublic void setSQLXML(int parameterIndex,
SQLXML xmlObject)
throws SQLException
setSQLXML in interface PreparedStatementSQLExceptionpublic void setArray(int parameterIndex,
Array x)
throws SQLException
setArray in interface PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setAsciiStream in interface PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setBinaryStream in interface PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream,
long length)
throws SQLException
setBlob in interface PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
long length)
throws SQLException
setCharacterStream in interface PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setClob in interface PreparedStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value)
throws SQLException
setNCharacterStream in interface PreparedStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value,
long length)
throws SQLException
setNCharacterStream in interface PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
NClob value)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setNClob in interface PreparedStatementSQLExceptionpublic void setNString(int parameterIndex,
String value)
throws SQLException
setNString in interface PreparedStatementSQLExceptionpublic void setRef(int parameterIndex,
Ref x)
throws SQLException
setRef in interface PreparedStatementSQLExceptionpublic void setRowId(int parameterIndex,
RowId x)
throws SQLException
setRowId in interface PreparedStatementSQLExceptionpublic void setUnicodeStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setUnicodeStream in interface PreparedStatementSQLExceptionpublic void setCommand(Object command)
Copyright © 2018 JBoss by Red Hat. All rights reserved.