Transaction Control In Jdbc Applications; Ibm Data Server Driver For Jdbc And Sqlj Isolation Levels - IBM DB2 Manual

Table of Contents

Advertisement

}

Transaction control in JDBC applications

In JDBC applications, as in other types of SQL applications, transaction control
involves explicitly or implicitly committing and rolling back transactions, and
setting the isolation level for transactions.

IBM Data Server Driver for JDBC and SQLJ isolation levels

The IBM Data Server Driver for JDBC and SQLJ supports a number of isolation
levels, which correspond to database server isolation levels.
JDBC isolation levels can be set for a unit of work within a JDBC program, using
the Connection.setTransactionIsolation method. The default isolation level can
be set with the defaultIsolationLevel property.
The following table shows the values of level that you can specify in the
Connection.setTransactionIsolation method and their DB2 database server
equivalents.
Table 17. Equivalent JDBC and DB2 isolation levels
JDBC value
TRANSACTION_SERIALIZABLE
TRANSACTION_REPEATABLE_READ
TRANSACTION_READ_COMMITTED
TRANSACTION_READ_UNCOMMITTED
The following table shows the values of level that you can specify in the
Connection.setTransactionIsolation method and their IBM Informix Dynamic
Server (IDS) equivalents.
Table 18. Equivalent JDBC and IDS isolation levels
JDBC value
java.sql.Connection.TRANSACTION_SERIALIZABLE
java.sql.Connection.TRANSACTION_REPEATABLE_READ
java.sql.Connection.TRANSACTION_READ_COMMITTED
java.sql.Connection.TRANSACTION_READ_UNCOMMITTED
com.ibm.db2.jcc.DB2Connection.TRANSACTION_IDS_CURSOR_STABILITY IDS cursor stability
com.ibm.db2.jcc.DB2Connection.TRANSACTION_IDS_LAST_COMMITTED
DB2Connection ds = (DB2Connection) con;
// Invoke updateDB2XmlSchema
ds.updateDB2XmlSchema(
xmlSchemaNameQualifierTarget,
xmlSchemaNameTarget,
xmlSchemaNameQualifierSource,
xmlSchemaNameSource,
dropSourceSchema);
Related concepts
"JDBC connection objects" on page 19
DB2 isolation level
Repeatable read
Read stability
Cursor stability
Uncommitted read
IDS isolation level
Repeatable read
Repeatable read
Committed read
Dirty read
Committed read, last committed
Chapter 3. JDBC application programming
73

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents