public class AS400JDBCPreparedStatementImpl extends AS400JDBCPreparedStatement
The AS400JDBCPreparedStatement class precompiles and stores an SQL statement. This provides the ability to efficiently run the statement multiple times. In addition, the statement may contain parameters. Use Connection.prepareStatement() to create new PreparedStatement objects.
When setting input parameter values, the caller must specify types that are compatible with the defined SQL type of the input parameter. For example, if the input parameter has SQL type INTEGER, then the caller must call setInt() to set the IN parameter value. If arbitrary type conversions are required, then use setObject() with a target SQL type.
For method that sets parameters, the application should not modify the parameter value until after the execute completes. Modifying a value between the setXXXX method and the execute method may result in unpredictable behavior.
extendedColumnDescriptors_
Modifier and Type | Method and Description |
---|---|
void |
addBatch()
Adds the set of parameters to the current batch.
|
void |
addBatch(java.lang.String sql)
Adds an SQL statement to the current batch of SQL statements.
|
void |
clearParameters()
Releases the resources used by the current input parameter values.
|
void |
close()
Releases the prepared statement's resources immediately instead of waiting
for them to be automatically released.
|
boolean |
execute()
Runs an SQL statement that may return multiple result sets.
|
boolean |
execute(java.lang.String sql)
Runs an SQL statement that may return multiple result sets.
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
Runs an SQL statement that may return multiple result sets and makes any
auto-generated keys available for retrieval using
Statement.getGeneratedKeys().
|
boolean |
execute(java.lang.String sql,
int[] columns)
Runs an SQL statement that may return multiple result sets and
makes any auto-generated keys for the columns indicated in the given array
available for retrieval using Statement.getGeneratedKeys().
|
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
Runs an SQL statement that may return multiple result sets and
makes any auto-generated keys for the columns indicated in the given array
available for retrieval using Statement.getGeneratedKeys().
|
int[] |
executeBatch()
Runs the batch of SQL statements.
|
long |
executeLargeUpdate()
Executes the SQL statement in this PreparedStatement object, which
must be an SQL Data Manipulation Language (DML) statement, such as
INSERT, UPDATE or DELETE; or an SQL statement that returns nothing,
such as a DDL statement.
|
long |
executeLargeUpdate(java.lang.String sql)
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE
statement or an SQL statement that returns nothing, such as an SQL DDL
statement.
|
long |
executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys)
Executes the given SQL statement and signals the driver with the given flag
about whether the auto-generated keys produced by this Statement object should
be made available for retrieval.
|
long |
executeLargeUpdate(java.lang.String sql,
int[] columnIndexes)
Executes the given SQL statement and signals the driver that the auto-generated
keys indicated in the given array should be made available for retrieval.
|
long |
executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Executes the given SQL statement and signals the driver that the
auto-generated keys indicated in the given array should be made
available for retrieval.
|
java.sql.ResultSet |
executeQuery()
Runs the SQL statement that returns a single result set.
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Runs an SQL statement that returns a single result set.
|
int |
executeUpdate()
Runs an SQL INSERT, UPDATE, or DELETE statement, or any SQL statement that
does not return a result set.
|
int |
executeUpdate(java.lang.String sql)
Runs an SQL INSERT, UPDATE, or DELETE statement, or any SQL statement that
does not return a result set.
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
Runs an SQL INSERT, UPDATE, or DELETE statement, or any SQL statement that
does not return a result set and makes any auto-generated keys available
for retrieval using Statement.getGeneratedKeys().
|
int |
executeUpdate(java.lang.String sql,
int[] columns)
Runs an SQL INSERT, UPDATE, or DELETE statement, or any
SQL statement that does not return a result set and
makes any auto-generated keys for the columns indicated in the given array
available for retrieval using Statement.getGeneratedKeys().
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Runs an SQL INSERT, UPDATE, or DELETE statement, or any
SQL statement that does not return a result set and
makes any auto-generated keys for the columns indicated in the given array
available for retrieval using Statement.getGeneratedKeys().
|
java.lang.String |
getDB2ParameterName(int parm)
Return the name of the parameter for a stored procedure call.
|
java.sql.ResultSetMetaData |
getMetaData()
Returns the ResultSetMetaData object that describes the result set's
columns.
|
java.sql.ParameterMetaData |
getParameterMetaData()
Returns the number, types, and properties of a PreparedStatement object's
parameters.
|
protected java.lang.String[] |
getValidWrappedList() |
void |
setArray(int parameterIndex,
java.sql.Array parameterValue)
Sets an input parameter to an Array value.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x)
Sets the designated parameter to the given input stream.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream parameterValue,
int length)
Sets an input parameter to an ASCII stream value.
|
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal parameterValue)
Sets an input parameter to a BigDecimal value.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x)
Sets the designated parameter to the given input stream.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream parameterValue,
int length)
Sets an input parameter to a binary stream value.
|
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
setBlob(int parameterIndex,
java.sql.Blob parameterValue)
Sets an input parameter to a Blob value.
|
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
setBlob(int parameterIndex,
java.io.InputStream inputStream,
long length)
Sets the designated parameter to an
InputStream object. |
void |
setBoolean(int parameterIndex,
boolean parameterValue)
Sets an input parameter to a Java boolean value.
|
void |
setByte(int parameterIndex,
byte parameterValue)
Sets an input parameter to a Java byte value.
|
void |
setBytes(int parameterIndex,
byte[] parameterValue)
Sets an input parameter to a Java byte array value.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader)
Sets the designated parameter to the given
Reader object. |
void |
setCharacterStream(int parameterIndex,
java.io.Reader parameterValue,
int length)
Sets an input parameter to a character stream value.
|
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
long length)
Sets the designated parameter to the given
Reader object,
which is the given number of characters long. |
void |
setClob(int parameterIndex,
java.sql.Clob parameterValue)
Sets an input parameter to a Clob value.
|
void |
setClob(int parameterIndex,
java.io.Reader reader)
Sets the designated parameter to a
Reader object. |
void |
setClob(int parameterIndex,
java.io.Reader reader,
long length)
Sets the designated parameter to a
Reader object. |
void |
setDate(int parameterIndex,
java.sql.Date parameterValue)
Sets an input parameter to a java.sql.Date value using the default
calendar.
|
void |
setDate(int parameterIndex,
java.sql.Date parameterValue,
java.util.Calendar calendar)
Sets an input parameter to a java.sql.Date value using a calendar other
than the default.
|
void |
setDB2Default(int parameterIndex)
Sets an input parameter to the default value
|
void |
setDB2Unassigned(int parameterIndex)
Sets an input parameter to unassigned
|
void |
setDBDefault(int parameterIndex)
Sets an input parameter to the default value.
|
void |
setDBUnassigned(int parameterIndex)
Sets an input parameter to unassigned.
|
void |
setDouble(int parameterIndex,
double parameterValue)
Sets an input parameter to a Java double value.
|
void |
setFloat(int parameterIndex,
float parameterValue)
Sets an input parameter to a Java float value.
|
void |
setInt(int parameterIndex,
int parameterValue)
Sets an input parameter to a Java int value.
|
void |
setLong(int parameterIndex,
long parameterValue)
Sets an input parameter to a Java long value.
|
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value)
Sets the designated parameter to a
Reader object. |
void |
setNCharacterStream(int parameterIndex,
java.io.Reader value,
long length)
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
java.io.Reader reader)
Sets the designated parameter to a
Reader object. |
void |
setNClob(int parameterIndex,
java.io.Reader reader,
long length)
Sets the designated parameter to a
Reader object. |
void |
setNString(int parameterIndex,
java.lang.String value)
Sets the designated paramter to the given
String object. |
void |
setNull(int parameterIndex,
int sqlType)
Sets an input parameter to SQL NULL.
|
void |
setNull(int parameterIndex,
int sqlType,
java.lang.String typeName)
Sets an input parameter to SQL NULL.
|
void |
setObject(int parameterIndex,
java.lang.Object parameterValue)
Sets an input parameter to an Object value.
|
void |
setObject(int parameterIndex,
java.lang.Object parameterValue,
int sqlType)
Sets an input parameter to an Object value.
|
void |
setObject(int parameterIndex,
java.lang.Object parameterValue,
int sqlType,
int scale)
Sets an input parameter to an Object value.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
java.lang.Object targetSqlType)
Sets the value of the designated parameter with the given object.
|
void |
setObject(int parameterIndex,
java.lang.Object x,
java.lang.Object targetSqlType,
int scaleOrLength)
Sets the value of the designated parameter with the given object.
|
void |
setRef(int parameterIndex,
java.sql.Ref parameterValue)
Sets an input parameter to a Ref value.
|
void |
setShort(int parameterIndex,
short parameterValue)
Sets an input parameter to a Java short value.
|
void |
setString(int parameterIndex,
java.lang.String parameterValue)
Sets an input parameter to a String value.
|
void |
setTime(int parameterIndex,
java.sql.Time parameterValue)
Sets an input parameter to a java.sql.Time value using the default
calendar.
|
void |
setTime(int parameterIndex,
java.sql.Time parameterValue,
java.util.Calendar calendar)
Sets an input parameter to a java.sql.Time value using a calendar other
than the default.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp parameterValue)
Sets an input parameter to a java.sql.Timestamp value using the default
calendar.
|
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp parameterValue,
java.util.Calendar calendar)
Sets an input parameter to a java.sql.Timestamp value using a calendar
other than the default.
|
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream parameterValue,
int length)
Deprecated.
Use setCharacterStream(int, Reader, int) instead.
|
void |
setURL(int parameterIndex,
java.net.URL parameterValue)
Sets an input parameter to a URL value.
|
cancel, clearBatch, clearWarnings, closeOnCompletion, endCancelThread, executeLargeBatch, finalize, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getPositionOfSyntaxError, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, startCancelThread, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
cancel, clearBatch, clearWarnings, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
public void addBatch() throws java.sql.SQLException
addBatch
in interface java.sql.PreparedStatement
addBatch
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open or an input parameter has not
been set.public void addBatch(java.lang.String sql) throws java.sql.SQLException
Do not use this form of addBatch() on a prepared statement.
addBatch
in interface java.sql.Statement
addBatch
in class AS400JDBCPreparedStatement
sql
- The SQL statement to be added to the current batch. This can be
any SQL statement that does not return a result set.java.sql.SQLException
- This exception is always thrown.public void clearParameters() throws java.sql.SQLException
clearParameters
in interface java.sql.PreparedStatement
clearParameters
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open.public void close() throws java.sql.SQLException
close
in interface java.sql.Statement
close
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public boolean execute() throws java.sql.SQLException
Under some situations, a single SQL statement may return multiple result sets, an update count, or both. This might occur either when executing a stored procedure that returns multiple result sets or when dynamically executing an unknown SQL string.
Use Statement.getMoreResults(), Statement.getResultSet(), and Statement.getUpdateCount() to navigate through multiple result sets, an update count, or both.
execute
in interface java.sql.PreparedStatement
execute
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open, the query timeout limit is
exceeded, or an error occurs.public boolean execute(java.lang.String sql) throws java.sql.SQLException
Do not use this form of execute() on a prepared statement.
execute
in interface java.sql.Statement
execute
in class AS400JDBCPreparedStatement
sql
- The SQL statement.java.sql.SQLException
- This exception is always thrown.public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
Do not use this form of execute() on a prepared statement.
execute
in interface java.sql.Statement
execute
in class AS400JDBCPreparedStatement
sql
- The SQL statement.autoGeneratedKeys
- Indicates whether auto-generated keys should be made available for
retrieval. Valid values are Statement.RETURN_GENERATED_KEYS and
Statement.NO_GENERATED_KEYS.java.sql.SQLException
- This exception is always thrown.public boolean execute(java.lang.String sql, int[] columns) throws java.sql.SQLException
AS400JDBCStatement
Under some situations, a single SQL statement may return multiple result sets, an update count, or both. This might occur when executing a stored procedure that returns multiple result sets or when dynamically executing an unknown SQL string.
Use getMoreResults(), getResultSet(), and getUpdateCount() to navigate through multiple result sets, an update count, or both.
This method is not supported when connecting to IBM i V5R4 or earlier systems.
execute
in interface java.sql.Statement
execute
in class AS400JDBCStatement
sql
- The SQL statement.columns
- Indicates that auto-generated keys for the indicated
columns should be made available for retrieval.java.sql.SQLException
- - If connecting to IBM i V5R4 or earlier systems,
if the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the value for columnIndexes is
not a valid value, or an error occurs.public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
AS400JDBCStatement
Under some situations, a single SQL statement may return multiple result sets, an update count, or both. This might occur when executing a stored procedure that returns multiple result sets or when dynamically executing an unknown SQL string.
Use getMoreResults(), getResultSet(), and getUpdateCount() to navigate through multiple result sets, an update count, or both.
This method is not supported when connecting to IBM i V5R4 or earlier systems.
execute
in interface java.sql.Statement
execute
in class AS400JDBCStatement
sql
- The SQL statement.columnNames
- Indicates that auto-generated keys for the indicated
columns should be made available for retrieval.java.sql.SQLException
- - If connecting to IBM i V5R4 or earlier systems,
if the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the value for columnNames is
not a valid value, or an error occurs.public int[] executeBatch() throws java.sql.SQLException
When batch updates are run, autocommit should usually be turned off. This allows the caller to decide whether or not to commit the transaction in the event that an error occurs and some of the SQL statements in a batch fail to run.
executeBatch
in interface java.sql.Statement
executeBatch
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open, an SQL statement contains a
syntax error, the query timeout limit is exceeded, an SQL
statement returns a result set, or an error occurs.public java.sql.ResultSet executeQuery() throws java.sql.SQLException
executeQuery
in interface java.sql.PreparedStatement
executeQuery
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open, no result set is returned by the
database, the query timeout limit is exceeded, an input
parameter has not been set, or an error occurs.public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
Do not use this form of executeQuery() on a prepared statement.
executeQuery
in interface java.sql.Statement
executeQuery
in class AS400JDBCPreparedStatement
sql
- The SQL statement.java.sql.SQLException
- This exception is always thrown.public int executeUpdate() throws java.sql.SQLException
executeUpdate
in interface java.sql.PreparedStatement
executeUpdate
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open, the query timeout limit is
exceeded, the statement returns a result set, an input
parameter has not been set, or an error occurs.public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
Do not use this form of executeUpdate() on a prepared statement.
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCPreparedStatement
sql
- The SQL statement.java.sql.SQLException
- This exception is always thrown.public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
Do not use this form of executeUpdate() on a prepared statement.
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCPreparedStatement
sql
- The SQL statement.java.sql.SQLException
- This exception is always thrown.public int executeUpdate(java.lang.String sql, int[] columns) throws java.sql.SQLException
AS400JDBCStatement
This method is not supported when connecting to IBM i V5R4 or earlier systems.
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCStatement
sql
- The SQL statement.columns
- The indexes of columns for which auto-generated keys should be made
available for retrieval.java.sql.SQLException
- If connection to IBM i V5R4 or earlier systems,
the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the statement returns
a result set, the value for autoGeneratedKeys is
not a valid value or an error occurs.public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
AS400JDBCStatement
This method is not supported when connecting to IBM i V5R4 or earlier systems.
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCStatement
sql
- The SQL statement.columnNames
- The column names for which auto-generated keys should be made
available for retrieval.java.sql.SQLException
- If connection to IBM i V5R4 or earlier systems,
the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the statement returns
a result set, the value for autoGeneratedKeys is
not a valid value or an error occurs.public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
PreparedStatement ps = connection .prepareStatement("INSERT INTO COLLECTION.TABLE VALUES(?)"); ResultSetMetaData rsmd = ps.getMetaData();
getMetaData
in interface java.sql.PreparedStatement
getMetaData
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open.public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
getParameterMetaData
in interface java.sql.PreparedStatement
getParameterMetaData
in class AS400JDBCPreparedStatement
java.sql.SQLException
- If the statement is not open.public void setArray(int parameterIndex, java.sql.Array parameterValue) throws java.sql.SQLException
setArray
in interface java.sql.PreparedStatement
setArray
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- Always thrown because DB2 for IBM i does not support arrays.public void setAsciiStream(int parameterIndex, java.io.InputStream parameterValue, int length) throws java.sql.SQLException
setAsciiStream
in interface java.sql.PreparedStatement
setAsciiStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.length
- The number of bytes in the stream.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the length is not valid,
the input stream does not contain all ASCII characters, or an
error occurs while reading the input stream.public void setBigDecimal(int parameterIndex, java.math.BigDecimal parameterValue) throws java.sql.SQLException
setBigDecimal
in interface java.sql.PreparedStatement
setBigDecimal
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setBinaryStream(int parameterIndex, java.io.InputStream parameterValue, int length) throws java.sql.SQLException
setBinaryStream
in interface java.sql.PreparedStatement
setBinaryStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.length
- The number of bytes in the stream.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the length is not valid,
or an error occurs while reading the input stream.public void setBlob(int parameterIndex, java.sql.Blob parameterValue) throws java.sql.SQLException
setBlob
in interface java.sql.PreparedStatement
setBlob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the parameter is not
serializable (when proxy support is in use).public void setBoolean(int parameterIndex, boolean parameterValue) throws java.sql.SQLException
setBoolean
in interface java.sql.PreparedStatement
setBoolean
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setByte(int parameterIndex, byte parameterValue) throws java.sql.SQLException
setByte
in interface java.sql.PreparedStatement
setByte
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setBytes(int parameterIndex, byte[] parameterValue) throws java.sql.SQLException
setBytes
in interface java.sql.PreparedStatement
setBytes
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setCharacterStream(int parameterIndex, java.io.Reader parameterValue, int length) throws java.sql.SQLException
setCharacterStream
in interface java.sql.PreparedStatement
setCharacterStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.length
- The number of characters to read from the reader.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the length is not valid,
or an error occurs while reading the character streampublic void setClob(int parameterIndex, java.sql.Clob parameterValue) throws java.sql.SQLException
setClob
in interface java.sql.PreparedStatement
setClob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the parameter is not
serializable (when proxy support is in use).public void setDate(int parameterIndex, java.sql.Date parameterValue) throws java.sql.SQLException
setDate
in interface java.sql.PreparedStatement
setDate
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setDate(int parameterIndex, java.sql.Date parameterValue, java.util.Calendar calendar) throws java.sql.SQLException
setDate
in interface java.sql.PreparedStatement
setDate
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.calendar
- The calendar.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the calendar is null.public void setDB2Default(int parameterIndex) throws java.sql.SQLException
setDB2Default
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter.public void setDBDefault(int parameterIndex) throws java.sql.SQLException
setDBDefault
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter.public void setDB2Unassigned(int parameterIndex) throws java.sql.SQLException
setDB2Unassigned
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter.public void setDBUnassigned(int parameterIndex) throws java.sql.SQLException
setDBUnassigned
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter.public void setDouble(int parameterIndex, double parameterValue) throws java.sql.SQLException
setDouble
in interface java.sql.PreparedStatement
setDouble
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid or the
parameter is not an input parameter.public void setFloat(int parameterIndex, float parameterValue) throws java.sql.SQLException
setFloat
in interface java.sql.PreparedStatement
setFloat
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setInt(int parameterIndex, int parameterValue) throws java.sql.SQLException
setInt
in interface java.sql.PreparedStatement
setInt
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid or the
parameter is not an input parameter.public void setLong(int parameterIndex, long parameterValue) throws java.sql.SQLException
setLong
in interface java.sql.PreparedStatement
setLong
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setNull(int parameterIndex, int sqlType) throws java.sql.SQLException
setNull
in interface java.sql.PreparedStatement
setNull
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).sqlType
- The SQL type code defined in java.sql.Types.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the SQL type is not
valid.public void setNull(int parameterIndex, int sqlType, java.lang.String typeName) throws java.sql.SQLException
setNull
in interface java.sql.PreparedStatement
setNull
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).sqlType
- The SQL type code defined in java.sql.Types.typeName
- The fully-qualified name of an SQL structured type. This value
will be ignored.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the SQL type is not
valid.public void setObject(int parameterIndex, java.lang.Object parameterValue) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
setObject
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the type of value is not
supported, or the parameter is not serializable (when proxy
support is in use).public void setObject(int parameterIndex, java.lang.Object parameterValue, int sqlType) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
setObject
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.sqlType
- The SQL type code defined in java.sql.Types.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the SQL type is not
valid, or the parameter is not serializable (when proxy
support is in use).public void setObject(int parameterIndex, java.lang.Object parameterValue, int sqlType, int scale) throws java.sql.SQLException
setObject
in interface java.sql.PreparedStatement
setObject
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.sqlType
- The SQL type code defined in java.sql.Types.scale
- The number of digits after the decimal if sqlType is DECIMAL or
NUMERIC.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the SQL type is not
valid, the scale is not valid, or the parameter is not
serializable (when proxy support is in use).public void setRef(int parameterIndex, java.sql.Ref parameterValue) throws java.sql.SQLException
setRef
in interface java.sql.PreparedStatement
setRef
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- Always thrown because DB2 for IBM i does not support structured types.public void setShort(int parameterIndex, short parameterValue) throws java.sql.SQLException
setShort
in interface java.sql.PreparedStatement
setShort
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value.java.sql.SQLException
- If the statement is not open, the index is not valid or the
parameter is not an input parameter.public void setString(int parameterIndex, java.lang.String parameterValue) throws java.sql.SQLException
setString
in interface java.sql.PreparedStatement
setString
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setTime(int parameterIndex, java.sql.Time parameterValue) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
setTime
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setTime(int parameterIndex, java.sql.Time parameterValue, java.util.Calendar calendar) throws java.sql.SQLException
setTime
in interface java.sql.PreparedStatement
setTime
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.calendar
- The calendar.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the calendar is null.public void setTimestamp(int parameterIndex, java.sql.Timestamp parameterValue) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
setTimestamp
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setTimestamp(int parameterIndex, java.sql.Timestamp parameterValue, java.util.Calendar calendar) throws java.sql.SQLException
setTimestamp
in interface java.sql.PreparedStatement
setTimestamp
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.calendar
- The calendar.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, or the calendar is null.public void setUnicodeStream(int parameterIndex, java.io.InputStream parameterValue, int length) throws java.sql.SQLException
Note that the number of bytes in a Unicode stream can be computed as 2 multiplied by the number of characters plus 2 bytes for the byte-order mark. If an uneven number of bytes is specified, then Java will convert this to an empty String.
setUnicodeStream
in interface java.sql.PreparedStatement
setUnicodeStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.length
- The number of bytes in the stream.java.sql.SQLException
- If the statement is not open, the index is not valid, the
parameter is not an input parameter, the length is not valid,
the input stream does not contain all Unicode characters, or
an error occurs while reading the input streamsetCharacterStream(int, java.io.Reader, int)
public void setURL(int parameterIndex, java.net.URL parameterValue) throws java.sql.SQLException
setURL
in interface java.sql.PreparedStatement
setURL
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).parameterValue
- The parameter value or null to set the value to SQL NULL.java.sql.SQLException
- If the statement is not open, the index is not valid, or the
parameter is not an input parameter.public void setNString(int parameterIndex, java.lang.String value) throws java.sql.SQLException
String
object. The
driver converts this to a SQL NCHAR
or NVARCHAR
or LONGNVARCHAR
value (depending on the argument's size
relative to the driver's limits on NVARCHAR
values) when it
sends it to the database.setNString
in interface java.sql.PreparedStatement
setNString
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).value
- the parameter valuejava.sql.SQLException
- If a database error occurs.
if the driver does not support national character sets; if the
driver can detect that a data conversion error could occur ; or
if a database access error occurspublic void setNCharacterStream(int parameterIndex, java.io.Reader value, long length) throws java.sql.SQLException
Reader
object. The
Reader
reads the data till end-of-file is reached. The driver
does the necessary conversion from Java character format to the national
character set in the database.setNCharacterStream
in interface java.sql.PreparedStatement
setNCharacterStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).value
- the parameter valuelength
- the number of characters in the parameter data.java.sql.SQLException
- If a database error occurs.
if the driver does not support national character sets; if the
driver can detect that a data conversion error could occur ; or
if a database access error occurspublic void setClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
Reader
object. The reader
must contain the number of characters specified by length otherwise a
SQLException
will be generated when the
PreparedStatement
is executed.setClob
in interface java.sql.PreparedStatement
setClob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement, or if the length specified is less than zero.public void setBlob(int parameterIndex, java.io.InputStream inputStream, long length) throws java.sql.SQLException
InputStream
object. The
inputStream must contain the number of characters specified by length
otherwise a SQLException
will be generated when the
PreparedStatement
is executed.setBlob
in interface java.sql.PreparedStatement
setBlob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).inputStream
- An object that contains the data to set the parameter value to.length
- the number of bytes in the parameter data.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement, if the length specified is less than zero or
if the number of bytes in the inputstream does not match the
specfied length.public void setNClob(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
Reader
object. The reader
must contain the number of characters specified by length otherwise a
SQLException
will be generated when the
PreparedStatement
is executed.setNClob
in interface java.sql.PreparedStatement
setNClob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement; if the length specified is less than zero; if
the driver does not support national character sets; if the
driver can detect that a data conversion error could occur; or if
a database access error occursprotected java.lang.String[] getValidWrappedList()
getValidWrappedList
in class AS400JDBCPreparedStatement
public void setAsciiStream(int parameterIndex, java.io.InputStream x, long length) throws java.sql.SQLException
LONGVARCHAR
parameter, it may be more practical to send it via
a java.io.InputStream
. Data will be read from the stream as
needed until end-of-file is reached. The JDBC driver will do any necessary
conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setAsciiStream
in interface java.sql.PreparedStatement
setAsciiStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).x
- the Java input stream that contains the ASCII parameter valuelength
- the number of bytes in the streamjava.sql.SQLException
- if a database access error occurs or this method is called on
a closed PreparedStatement
public void setBinaryStream(int parameterIndex, java.io.InputStream x, long length) throws java.sql.SQLException
LONGVARBINARY
parameter, it may be more practical to send it
via a java.io.InputStream
object. The data will be read from
the stream as needed until end-of-file is reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setBinaryStream
in interface java.sql.PreparedStatement
setBinaryStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).x
- the java input stream which contains the binary parameter valuelength
- the number of bytes in the streamjava.sql.SQLException
- if a database access error occurs or this method is called on
a closed PreparedStatement
public void setCharacterStream(int parameterIndex, java.io.Reader reader, long length) throws java.sql.SQLException
Reader
object,
which is the given number of characters long. When a very large UNICODE
value is input to a LONGVARCHAR
parameter, it may be more
practical to send it via a java.io.Reader
object. The data
will be read from the stream as needed until end-of-file is reached. The
JDBC driver will do any necessary conversion from UNICODE to the database
char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setCharacterStream
in interface java.sql.PreparedStatement
setCharacterStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- the java.io.Reader
object that contains the Unicode
datalength
- the number of characters in the streamjava.sql.SQLException
- if a database access error occurs or this method is called on
a closed PreparedStatement
public java.lang.String getDB2ParameterName(int parm) throws java.sql.SQLException
getDB2ParameterName
in class AS400JDBCPreparedStatement
parm
- the parameter number to get the name forjava.sql.SQLException
- If a database error occurs.public void setAsciiStream(int parameterIndex, java.io.InputStream x) throws java.sql.SQLException
LONGVARCHAR
parameter, it may be
more practical to send it via a java.io.InputStream
. Data will
be read from the stream as needed until end-of-file is reached. The JDBC
driver will do any necessary conversion from ASCII to the database char
format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setAsciiStream
in interface java.sql.PreparedStatement
setAsciiStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).x
- the Java input stream that contains the ASCII parameter valuejava.sql.SQLException
- if parameterIndex does not correspond to a parameter marker in
the SQL statement; if a database access error occurs or this
method is called on a closed PreparedStatement
public void setBinaryStream(int parameterIndex, java.io.InputStream x) throws java.sql.SQLException
LONGVARBINARY
parameter, it may be
more practical to send it via a java.io.InputStream
object.
The data will be read from the stream as needed until end-of-file is
reached.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
setBinaryStream
in interface java.sql.PreparedStatement
setBinaryStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).x
- the java input stream which contains the binary parameter valuejava.sql.SQLException
- if parameterIndex does not correspond to a parameter marker in
the SQL statement; if a database access error occurs or this
method is called on a closed PreparedStatement
public void setBlob(int parameterIndex, java.io.InputStream inputStream) throws java.sql.SQLException
InputStream
object. This
method differs from the setBinaryStream (int, InputStream)
method because it informs the driver that the parameter value should be
sent to the server as a BLOB
. When the
setBinaryStream
method is used, the driver may have to do
extra work to determine whether the parameter data should be sent to the
server as a LONGVARBINARY
or a BLOB
setBlob
in interface java.sql.PreparedStatement
setBlob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).inputStream
- An object that contains the data to set the parameter value to.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement; if a database access error occurs; this method
is called on a closed PreparedStatement
or if
parameterIndex does not correspond to a parameter marker in the
SQL statement,public void setCharacterStream(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
Reader
object. When
a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will do any
necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it
might be more efficient to use a version of setCharacterStream
which takes a length parameter.
setCharacterStream
in interface java.sql.PreparedStatement
setCharacterStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- the java.io.Reader
object that contains the Unicode
datajava.sql.SQLException
- if parameterIndex does not correspond to a parameter marker in
the SQL statement; if a database access error occurs or this
method is called on a closed PreparedStatement
public void setClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
Reader
object. This method
differs from the setCharacterStream (int, Reader)
method
because it informs the driver that the parameter value should be sent to
the server as a CLOB
. When the setCharacterStream
method is used, the driver may have to do extra work to determine whether
the parameter data should be sent to the server as a
LONGVARCHAR
or a CLOB
Note: Consult your JDBC driver documentation to determine if it
might be more efficient to use a version of setClob
which
takes a length parameter.
setClob
in interface java.sql.PreparedStatement
setClob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- An object that contains the data to set the parameter value to.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement; if a database access error occurs; this method
is called on a closed PreparedStatement
or if
parameterIndex does not correspond to a parameter marker in the
SQL statementpublic void setNCharacterStream(int parameterIndex, java.io.Reader value) throws java.sql.SQLException
Reader
object. The
Reader
reads the data till end-of-file is reached. The driver
does the necessary conversion from Java character format to the national
character set in the database.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
Note: Consult your JDBC driver documentation to determine if it
might be more efficient to use a version of
setNCharacterStream
which takes a length parameter.
setNCharacterStream
in interface java.sql.PreparedStatement
setNCharacterStream
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).value
- the parameter valuejava.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs; or this
method is called on a closed PreparedStatement
public void setNClob(int parameterIndex, java.io.Reader reader) throws java.sql.SQLException
Reader
object. This method
differs from the setCharacterStream (int, Reader)
method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB
. When the
setCharacterStream
method is used, the driver may have to do
extra work to determine whether the parameter data should be sent to the
server as a LONGNVARCHAR
or a NCLOB
Note: Consult your JDBC driver documentation to determine if it
might be more efficient to use a version of setNClob
which
takes a length parameter.
setNClob
in interface java.sql.PreparedStatement
setNClob
in class AS400JDBCPreparedStatement
parameterIndex
- The parameter index (1-based).reader
- An object that contains the data to set the parameter value to.java.sql.SQLException
- If a database error occurs.
if parameterIndex does not correspond to a parameter marker in
the SQL statement; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; if a database access error occurs or this
method is called on a closed PreparedStatement
public void setObject(int parameterIndex, java.lang.Object x, java.lang.Object targetSqlType, int scaleOrLength) throws java.sql.SQLException
The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should pass it to the database as a value of the corresponding SQL type.
Note that this method may be used to pass database-specific abstract data types.
setObject
in class AS400JDBCPreparedStatement
parameterIndex
- - the first parameter is 1, the second is 2, ...x
- - the object containing the input parameter valuetargetSqlType
- - the SQL type to be sent to the database. The scale argument may
further qualify this type.scaleOrLength
- - for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC
types, this is the number of digits after the decimal point. For Java Object types
InputStream and Reader, this is the length of the data in the stream or reader.
For all other types, this value will be ignored.java.sql.SQLException
- - if parameterIndex does not correspond to a parameter
marker in the SQL statement; if a database access error occurs or this method
is called on a closed PreparedStatement or if the Java Object specified by x
is an InputStream or Reader object and the value of the scale parameter is
less than zeropublic void setObject(int parameterIndex, java.lang.Object x, java.lang.Object targetSqlType) throws java.sql.SQLException
setObject
in class AS400JDBCPreparedStatement
parameterIndex
- - the first parameter is 1, the second is 2, ...x
- - the object containing the input parameter valuetargetSqlType
- - the SQL type to be sent to the database parameterIndexjava.sql.SQLException
- - if parameterIndex does not correspond to a parameter marker
in the SQL statement; if a database access error occurs or this method is called
on a closed PreparedStatementpublic long executeLargeUpdate() throws java.sql.SQLException
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
executeLargeUpdate
in class AS400JDBCPreparedStatement
java.sql.SQLException
- - if a database access error occurs; this method is called on a
closed PreparedStatement or the SQL statement returns a ResultSet objectpublic long executeLargeUpdate(java.lang.String sql) throws java.sql.SQLException
AS400JDBCStatement
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
Note:This method cannot be called on a PreparedStatement or CallableStatement.
executeLargeUpdate
in class AS400JDBCStatement
sql
- an SQL Data Manipulation Language (DML) statement, such as INSERT,
UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL
statement.java.sql.SQLException
- - if a database access error occurs, this method is
called on a closed Statement, the given SQL statement produces a ResultSet
object, the method is called on a PreparedStatement or CallableStatement.public long executeLargeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
AS400JDBCStatement
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
executeLargeUpdate
in class AS400JDBCStatement
sql
- - an SQL Data Manipulation Language (DML) statement, such as
INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such
as a DDL statement.autoGeneratedKeys
- - a flag indicating whether auto-generated keys
should be made available for retrieval; one of the following constants:
Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYSjava.sql.SQLException
- - if a database access error occurs, this method is
called on a closed Statement, the given SQL statement returns a ResultSet
object, the given constant is not one of those allowed, the method is
called on a PreparedStatement or CallableStatementpublic long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
AS400JDBCStatement
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
Note:This method cannot be called on a PreparedStatement or CallableStatement.
executeLargeUpdate
in class AS400JDBCStatement
sql
- - an SQL Data Manipulation Language (DML) statement, such as INSERT,
UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL
statement.columnIndexes
- - an array of column indexes indicating the columns that
should be returned from the inserted rowjava.sql.SQLException
- - if a database access error occurs, this method is called
on a closed Statement, the SQL statement returns a ResultSet object,the second
argument supplied to this method is not an int array whose elements are valid
column indexes, the method is called on a PreparedStatement or CallableStatementpublic long executeLargeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
AS400JDBCStatement
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
Note:This method cannot be called on a PreparedStatement or CallableStatement.
executeLargeUpdate
in class AS400JDBCStatement
sql
- - an SQL Data Manipulation Language (DML) statement, such as
INSERT, UPDATE or DELETE; or an SQL statement that returns nothing,
such as a DDL statement.columnNames
- - an array of the names of the columns that
should be returned from the inserted rowjava.sql.SQLException
- if a database access error occurs, this method
is called on a closed Statement, the SQL statement returns a ResultSet
object, the second argument supplied to this method is not a String
array whose elements are valid column names, the method is called on a
PreparedStatement or CallableStatement