The com.ibm.db2.jcc.DB2Statement interface extends the java.sql.Statement interface.
The following fields are defined only for the IBM® Data Server Driver for JDBC and SQLJ.
The following methods are defined only for the IBM Data Server Driver for JDBC and SQLJ.
public java.sql.ResultSet DB2Statement.executeDB2OptimisticLockingQuery(
String sql,
int returnOptLockingColumn)
throws java.sql.SQLException
Executes an SQL query statement, and returns a ResultSet that contains optimistic locking information, if it is requested.
Value | Description |
---|---|
DB2Statement.RETURN_OPTLOCK_COLUMN_NONE (0) | Do not return optimistic locking columns. |
DB2Statement.RETURN_OPTLOCK_COLUMN_ALWAYS (1) | Add row change columns to the result set even if they do not uniquely represent a single row. This setting is equivalent to the database prepare attribute WITH ROW CHANGE COLUMNS POSSIBLY DISTINCT. |
DB2Statement.RETURN_OPTLOCK_COLUMN_NO_FALSE_NEGATIVES (2) | Add row change columns to the result set only if they uniquely represent a single row. This setting is equivalent to the database prepare attribute WITH ROW CHANGE COLUMNS ALWAYS DISTINCT. |
public int getAffectedRowCount()
throws java.sql.SQLException
Returns the number of rows that are affected by successful execution of an SQL statement. If the SQL statement is INSERT, UPDATE, or DELETE, getAffectedRowCount returns the same value that is returned by java.sql.Statement.getUpdateCount.
The value that is returned by getAffectedRowCount is the same information that is returned by the data server in the SQLCA after successful execution of an SQL statement.
public String getDB2ClientProgramId()
throws java.sql.SQLException
Returns the user-defined client program identifier for the connection, which is stored on the data source.
getDB2ClientProgramId does not apply to DB2® for Linux, UNIX, and Windows data servers.
public abstract void setDB2ClientProgramId(String program-ID)
throws java.sql.SQLException
Sets a user-defined program identifier for the connection on a data server. That program identifier is an 80-byte string that is used to identify the caller.
setDB2ClientProgramId does not apply to DB2 for Linux, UNIX, and Windows data servers.
The DB2 for z/OS® server places the string in IFCID 316 trace records along with other statistics, so that you can identify which program is associated with a particular SQL statement.
public int getIDSBigSerial()
throws java.sql.SQLException
Retrieves an automatically generated key from a BIGSERIAL column after the automatically generated key was inserted by a previously executed INSERT statement.
This method applies only to connections to IBM Informix® databases.
public int getIDSSerial()
throws java.sql.SQLException
Retrieves an automatically generated key from a SERIAL column after the automatically generated key was inserted by a previously executed INSERT statement.
This method applies only to connections to IBM Informix databases.
public long getIDSSerial8()
throws java.sql.SQLException
Retrieves an automatically generated key from a SERIAL8 column after the automatically generated key was inserted by a previously executed INSERT statement.
This method applies only to connections to IBM Informix data sources.
public int getIDSSQLStatementOffSet()
throws java.sql.SQLException
After an SQL statement executes on an IBM Informix data source, if the statement has a syntax error, getIDSSQLStatementOffSet returns the offset into the statement text of the syntax error.
This method applies only to connections to IBM Informix data sources.