public class AS400JDBCStatementRedirect extends AS400JDBCStatement
extendedColumnDescriptors_
Modifier and Type | Method and Description |
---|---|
void |
addBatch(java.lang.String sql)
Adds an SQL statement to the current batch of SQL statements.
|
void |
cancel()
Cancels the statement.
|
void |
clearBatch()
Clears the current batch of SQL statements.
|
void |
clearWarnings()
Clears all warnings that have been reported for the statement.
|
void |
close()
Releases the statement's resources immediately instead of waiting
for them to be automatically released.
|
void |
closeOnCompletion()
Specifies that this Statement will be closed when all its dependent result sets are closed.
|
protected void |
endCancelThread()
endTheCancelThread
|
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[] columnIndexes)
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[] |
executeLargeBatch()
Submits a batch of commands to the database for execution and if all commands
execute successfully, returns an array of update counts.
|
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(java.lang.String sql)
Runs an SQL statement that returns a single 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[] columnIndexes)
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.sql.Connection |
getConnection()
Returns the connection for this statement.
|
int |
getFetchDirection()
Returns the fetch direction.
|
int |
getFetchSize()
Returns the fetch size.
|
java.sql.ResultSet |
getGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this Statement object.
|
long |
getLargeMaxRows()
Retrieves the maximum number of rows that a ResultSet object produced by this
Statement object can contain.
|
long |
getLargeUpdateCount()
Retrieves the current result as an update count; if the result is a ResultSet object
or there are no more results, -1 is returned.
|
int |
getMaxFieldSize()
Returns the maximum field size limit for the statement.
|
int |
getMaxRows()
Returns the maximum rows limit for the statement.
|
boolean |
getMoreResults()
Returns the next result set.
|
boolean |
getMoreResults(int current)
Returns the next result set.
|
int |
getPositionOfSyntaxError()
Will return the value of the last syntax error that came back from the IBM i system.
|
int |
getQueryTimeout()
Returns the query timeout limit for this statement.
|
java.sql.ResultSet |
getResultSet()
Returns the current result set.
|
int |
getResultSetConcurrency()
Returns the result set concurrency to be used for this statement.
|
int |
getResultSetHoldability()
Returns the result set cursor holdability to be used for this statement.
|
int |
getResultSetType()
Returns the result set type to be used for this statement.
|
int |
getUpdateCount()
Returns the current update count.
|
protected java.lang.String[] |
getValidWrappedList() |
java.sql.SQLWarning |
getWarnings()
Returns the first warning reported for the statement.
|
boolean |
isClosed()
Indicates if the statement is closed.
|
boolean |
isCloseOnCompletion()
Returns a value indicating whether this Statement will be closed when all its dependent result sets are closed.
|
boolean |
isPoolable()
Returns the value of the statements poolable hint, indicating whether
pooling of the statement is requested.
|
void |
setCursorName(java.lang.String name)
Sets the SQL cursor name that will be used by the statement.
|
void |
setEscapeProcessing(boolean enable)
Sets the escape processing mode.
|
void |
setFetchDirection(int direction)
Sets the direction in which the rows in a result set will be
processed.
|
void |
setFetchSize(int rows)
Sets the number of rows to be fetched from the database when more
rows are needed.
|
void |
setLargeMaxRows(long max)
Sets the limit for the maximum number of rows that any ResultSet object
generated by this Statement object can contain to the given number.
|
void |
setMaxFieldSize(int max)
Sets the maximum field size limit.
|
void |
setMaxRows(int max)
Sets the maximum rows limit.
|
void |
setPoolable(boolean poolable)
Requests that a
Statement be pooled or not pooled. |
void |
setQueryTimeout(int seconds)
Sets the query timeout limit.
|
protected void |
startCancelThread()
Handles the work involved in supporting a setQueryTimeout option with the cancel property set. .
|
java.lang.String |
toString()
Returns the statement name.
|
finalize
public void addBatch(java.lang.String sql) throws java.sql.SQLException
AS400JDBCStatement
addBatch
in interface java.sql.Statement
addBatch
in class AS400JDBCStatement
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
- If the statement is not open or
the SQL statement contains a syntax
error.public void cancel() throws java.sql.SQLException
AS400JDBCStatement
cancel
in interface java.sql.Statement
cancel
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open or
an error occurs.public void clearBatch() throws java.sql.SQLException
AS400JDBCStatement
clearBatch
in interface java.sql.Statement
clearBatch
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public void clearWarnings() throws java.sql.SQLException
AS400JDBCStatement
clearWarnings
in interface java.sql.Statement
clearWarnings
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public void close() throws java.sql.SQLException
AS400JDBCStatement
close
in interface java.sql.Statement
close
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public boolean execute(java.lang.String sql) 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.
execute
in interface java.sql.Statement
execute
in class AS400JDBCStatement
sql
- The SQL statement.java.sql.SQLException
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, or an error occurs.public boolean execute(java.lang.String sql, int autoGeneratedKeys) 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 requires OS/400 V5R2 or IBM i. If connecting to OS/400 V5R1 or earlier, an exception will be thrown.
execute
in interface java.sql.Statement
execute
in class AS400JDBCStatement
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
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the value for autoGeneratedKeys is
not a valid value, if connecting to OS/400 V5R1
or earlier, an error occurs.public boolean execute(java.lang.String sql, int[] columnIndexes) 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.columnIndexes
- 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
AS400JDBCStatement
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 AS400JDBCStatement
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(java.lang.String sql) throws java.sql.SQLException
AS400JDBCStatement
executeQuery
in interface java.sql.Statement
executeQuery
in class AS400JDBCStatement
sql
- The SQL statement.java.sql.SQLException
- If the statement is not open,
the SQL statement contains a syntax
error, no result set is returned by the
database, the query timeout limit is
exceeded, or an error occurs.public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
AS400JDBCStatement
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCStatement
sql
- The SQL statement.java.sql.SQLException
- If the statement is not open,
the SQL statement contains a syntax
error, the query timeout limit is
exceeded, the statement returns
a result set, or an error occurs.public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
AS400JDBCStatement
This method requires OS/400 V5R2 or or IBM i. If connecting to OS/400 V5R1 or earlier, an exception will be thrown.
executeUpdate
in interface java.sql.Statement
executeUpdate
in class AS400JDBCStatement
sql
- The SQL statement.java.sql.SQLException
- If 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, if connecting to OS/400 V5R1
or earlier, an error occurs.public int executeUpdate(java.lang.String sql, int[] columnIndexes) 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.columnIndexes
- 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.Connection getConnection() throws java.sql.SQLException
AS400JDBCStatement
getConnection
in interface java.sql.Statement
getConnection
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public int getFetchDirection() throws java.sql.SQLException
AS400JDBCStatement
getFetchDirection
in interface java.sql.Statement
getFetchDirection
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getFetchSize() throws java.sql.SQLException
AS400JDBCStatement
getFetchSize
in interface java.sql.Statement
getFetchSize
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
AS400JDBCStatement
In order for this method to return auto-generated keys, the statement must be executed on a table with an identity column. For more information about identity columns, Go to the IBM i Information Center, and search on the phrase "identity column".
This method will return null if the user did not request auto-generated keys during the execute of a Statement or during the prepare of a PreparedStatement. This method will also return null if the application has not executed the statement before calling this method.
This method will return an empty result set if the database did not generate any auto-generated keys when executing the statement.
getGeneratedKeys
in interface java.sql.Statement
getGeneratedKeys
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open,
if connecting to OS/400 V5R1 or earlier,
an error occurs.public int getMaxFieldSize() throws java.sql.SQLException
AS400JDBCStatement
getMaxFieldSize
in interface java.sql.Statement
getMaxFieldSize
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getMaxRows() throws java.sql.SQLException
AS400JDBCStatement
getMaxRows
in interface java.sql.Statement
getMaxRows
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public boolean getMoreResults() throws java.sql.SQLException
AS400JDBCStatement
getMoreResults
in interface java.sql.Statement
getMoreResults
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public boolean getMoreResults(int current) throws java.sql.SQLException
AS400JDBCStatement
getMoreResults
in interface java.sql.Statement
getMoreResults
in class AS400JDBCStatement
current
- What should happen to current ResultSet objects
obtained using the method getResultSet. Valid values are
CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, and CLOSE_ALL_RESULTS.java.sql.SQLException
- if DatabaseMetaData.supportsMultipleOpenResults returns false
and either Statement.KEEP_CURRENT_RESULT or Statement.CLOSE_ALL_RESULTS are
supplied as the argument.public int getPositionOfSyntaxError() throws java.sql.SQLException
AS400JDBCStatement
getPositionOfSyntaxError
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getQueryTimeout() throws java.sql.SQLException
AS400JDBCStatement
getQueryTimeout
in interface java.sql.Statement
getQueryTimeout
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public java.sql.ResultSet getResultSet() throws java.sql.SQLException
AS400JDBCStatement
getResultSet
in interface java.sql.Statement
getResultSet
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getResultSetConcurrency() throws java.sql.SQLException
AS400JDBCStatement
getResultSetConcurrency
in interface java.sql.Statement
getResultSetConcurrency
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getResultSetHoldability() throws java.sql.SQLException
AS400JDBCStatement
getResultSetHoldability
in interface java.sql.Statement
getResultSetHoldability
in class AS400JDBCStatement
cursor hold
driver property.java.sql.SQLException
- If the statement is not open.public int getResultSetType() throws java.sql.SQLException
AS400JDBCStatement
getResultSetType
in interface java.sql.Statement
getResultSetType
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public int getUpdateCount() throws java.sql.SQLException
AS400JDBCStatement
getUpdateCount
in interface java.sql.Statement
getUpdateCount
in class AS400JDBCStatement
java.sql.SQLException
- If the statement is not open.public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
AS400JDBCStatement
getWarnings
in interface java.sql.Statement
getWarnings
in class AS400JDBCStatement
java.sql.SQLException
- If an error occurs.public boolean isClosed() throws java.sql.SQLException
AS400JDBCStatement
isClosed
in interface java.sql.Statement
isClosed
in class AS400JDBCStatement
java.sql.SQLException
- If a database error occurs.public void setCursorName(java.lang.String name) throws java.sql.SQLException
AS400JDBCStatement
The cursor name can be used in SQL positioned UPDATE or DELETE statements to identify the current row in the result set generated by this statement. By definition, SQL positioned UPDATEs or DELETEs must be executed by a different statement than the one that generated the result set being used for positioning.
Cursor names are case sensitive. However, when using a cursor name within other SQL positioned UPDATE or DELETE statements, the cursor name will be uppercased. If you use a cursor name with lowercase characters, you need to enclose it in double quotes when referring to it in other SQL statements.
setCursorName
in interface java.sql.Statement
setCursorName
in class AS400JDBCStatement
name
- The cursor name. If null, a unique
default name will be used.java.sql.SQLException
- If the statement is not open,
a result set is open, the cursor
name is not unique within the
connection, or an error occurs.public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
AS400JDBCStatement
setEscapeProcessing
in interface java.sql.Statement
setEscapeProcessing
in class AS400JDBCStatement
enable
- true to process escape clauses;
false otherwise. The default
is true.java.sql.SQLException
- If the statement is not open.public void setFetchDirection(int direction) throws java.sql.SQLException
AS400JDBCStatement
This setting is not used.
setFetchDirection
in interface java.sql.Statement
setFetchDirection
in class AS400JDBCStatement
direction
- The fetch direction for processing rows.
Valid values are:
java.sql.SQLException
- If the statement is not open,
the result set type is
ResultSet.TYPE_FORWARD_ONLY,
and the input value is not
ResultSet.FETCH_FORWARD,
or the input value is not valid.public void setFetchSize(int rows) throws java.sql.SQLException
AS400JDBCStatement
This setting only affects statements that meet the criteria specified in the "block criteria" property. The fetch size is only used if the "block size" property is set to "0".
This setting only takes effect for result sets that are opened after this method has been called. Ideally, this method should be called before the statement is executed.
setFetchSize
in interface java.sql.Statement
setFetchSize
in class AS400JDBCStatement
rows
- The number of rows. This must be greater than
or equal to 0 and less than or equal to the
maximum rows limit. The default is zero.java.sql.SQLException
- If the statement is not open
or the input value is not valid.public void setMaxFieldSize(int max) throws java.sql.SQLException
AS400JDBCStatement
setMaxFieldSize
in interface java.sql.Statement
setMaxFieldSize
in class AS400JDBCStatement
max
- The maximum field size limit (in bytes) or
0 for no limit. The default is 0.java.sql.SQLException
- If the statement is not open
or the input value is not valid.public void setMaxRows(int max) throws java.sql.SQLException
AS400JDBCStatement
setMaxRows
in interface java.sql.Statement
setMaxRows
in class AS400JDBCStatement
max
- The maximum rows limit or 0 for no limit.
The default is 0.java.sql.SQLException
- If the statement is not open
or the input value is not valid.public void setQueryTimeout(int seconds) throws java.sql.SQLException
AS400JDBCStatement
This is implemented using the database query time limit, also known as QQRYTIMLMT. This value specifies the query processing time limit that is compared to the estimated number of elapsed seconds that a query must run. The time limit determines if the database query can start.
Beginning with Version 6 Release 1 of IBM i, you must have *JOBCTL special authority.
setQueryTimeout
in interface java.sql.Statement
setQueryTimeout
in class AS400JDBCStatement
seconds
- The query timeout limit (in seconds)
or 0 for no limit. The default is the job's query timeout limit
value unless this method is explicitly called.java.sql.SQLException
- If the statement is not open
or the input value is not valid.public java.lang.String toString()
AS400JDBCStatement
toString
in class AS400JDBCStatement
public void setPoolable(boolean poolable) throws java.sql.SQLException
AS400JDBCStatement
Statement
be pooled or not pooled. The value
specified is a hint to the statement pool implementation indicating
whether the applicaiton wants the statement to be pooled. It is up to
the statement pool manager as to whether the hint is used.
The poolable value of a statement is applicable to both internal statement caches implemented by the driver and external statement caches implemented by application servers and other applications.
By default, a Statement
is poolable when it is created.
setPoolable
in interface java.sql.Statement
setPoolable
in class AS400JDBCStatement
poolable
- requests that the statement be pooled if true and
that the statement not be pooled if false
java.sql.SQLException
- if the Statement
has been closedpublic boolean isPoolable() throws java.sql.SQLException
AS400JDBCStatement
isPoolable
in interface java.sql.Statement
isPoolable
in class AS400JDBCStatement
java.sql.SQLException
- if the Statement
has been closed
see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)
protected java.lang.String[] getValidWrappedList()
getValidWrappedList
in class AS400JDBCStatement
public void closeOnCompletion() throws java.sql.SQLException
AS400JDBCStatement
Note: Multiple calls to closeOnCompletion do not toggle the effect on this Statement. However, a call to closeOnCompletion does effect both the subsequent execution of statements, and statements that currently have open, dependent, result sets.
closeOnCompletion
in class AS400JDBCStatement
java.sql.SQLException
- - if this method is called on a closed Statementpublic boolean isCloseOnCompletion() throws java.sql.SQLException
AS400JDBCStatement
isCloseOnCompletion
in class AS400JDBCStatement
java.sql.SQLException
- - if this method is called on a closed Statementprotected void startCancelThread()
AS400JDBCStatement
startCancelThread
in class AS400JDBCStatement
protected void endCancelThread()
AS400JDBCStatement
endCancelThread
in class AS400JDBCStatement
public long getLargeUpdateCount() throws java.sql.SQLException
AS400JDBCStatement
Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned. This method should be called only once per result.
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
getLargeUpdateCount
in class AS400JDBCStatement
java.sql.SQLException
- - if a database access error occurs or this method is
called on a closed Statementpublic void setLargeMaxRows(long max) throws java.sql.SQLException
AS400JDBCStatement
Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number. If the limit is exceeded, the excess rows are silently dropped.
This method should be used when the row limit may exceed Integer.MAX_VALUE.
setLargeMaxRows
in class AS400JDBCStatement
max
- the new max rows limit; zero means there is no limitjava.sql.SQLException
- - if a database access error occurs, this
method is called on a closed Statement or the
condition max >= 0 is not satisfiedpublic long getLargeMaxRows() throws java.sql.SQLException
AS400JDBCStatement
This method should be used when the returned row limit may exceed Integer.MAX_VALUE.
getLargeMaxRows
in class AS400JDBCStatement
java.sql.SQLException
- -if a database access error occurs or this method is
called on a closed Statementpublic long[] executeLargeBatch() throws java.sql.SQLException
AS400JDBCStatement
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The long elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeLargeBatch may be one of the following:
A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
A value of SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows affected is unknown.
If one of the commands in a batch update fails to execute properly, this method throws a BatchUpdateException, and a JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process commands or never continuing to process commands. If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getLargeUpdateCounts will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:
A value of EXECUTE_FAILED -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails
This method should be used when the returned row count may exceed Integer.MAX_VALUE.
executeLargeBatch
in class AS400JDBCStatement
java.sql.SQLException
- - if a database access error occurs, this method is called
on a closed Statement or the driver does not support batch statements.
Throws BatchUpdateException (a subclass of SQLException) if one of the commands
sent to the database fails to execute properly or attempts to return a result set.public 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