EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #367 background imageLoading...
Page #367 background image
Retrieves the total time in milliseconds for requests that were blocked by the
pool. This time can be much larger than the elapsed execution time of the
application if the application uses multiple threads.
DB2PreparedStatement interface
The com.ibm.db2.jcc.DB2PreparedStatement interface extends the
com.ibm.db2.jcc.DB2Statement and java.sql.PreparedStatement interfaces.
DB2PreparedStatement methods
The following methods are defined only for the IBM Data Server Driver for JDBC
and SQLJ.
executeDB2QueryBatch
Format:
public void executeDB2QueryBatch()
throws java.sql.SQLException
Executes a statement batch that contains queries with parameters.
This method is not supported for connections to IBM Informix Dynamic Server
data sources.
getDBGeneratedKeys
Format:
public java.sql.ResultSet[] getDBGeneratedKeys()
throws java.sql.SQLException
Retrieves automatically generated keys that were created when INSERT
statements were executed in a batch. Each ResultSet object that is returned
contains the automatically generated keys for a single statement in the batch.
getDBGeneratedKeys returns an array of length 0 under the following
conditions:
v getDBGeneratedKeys is called out of sequence. For example, if
getDBGeneratedKeys is called before executeBatch, an array of length 0 is
returned.
v The PreparedStatement that is executed in a batch was not created using one
of the following methods:
Connection.prepareStatement(String sql, int[] autoGeneratedKeys)
Connection.prepareStatement(String sql, String[] autoGeneratedColumnNames)
Connection.prepareStatement(String sql, Statement.RETURN_GENERATED_KEYS)
If getDBGeneratedKeys is called against a PreparedStatement that was created
using one of the previously listed methods, and the PreparedStatement is not
in a batch, a single ResultSet is returned.
Related tasks
“Making batch queries in JDBC applications” on page 34
Related reference
“DB2Statement interface” on page 354
DB2ResultSetMetaData interface
The com.ibm.db2.jcc.DB2ResultSetMetaData interface provides methods that
provide information about a ResultSet object.
Chapter 7. JDBC and SQLJ reference information 351
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability