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 1. Equivalent JDBC and Db2 isolation levels
JDBC value Db2 isolation level
java.sql.Connection.TRANSACTION_SERIALIZABLE Repeatable read
java.sql.Connection.TRANSACTION_REPEATABLE_READ Read stability
java.sql.Connection.TRANSACTION_READ_COMMITTED Cursor stability
java.sql.Connection.TRANSACTION_READ_UNCOMMITTED Uncommitted read

The following table shows the values of level that you can specify in the Connection.setTransactionIsolation method and their IBM Informix® equivalents.

Table 2. Equivalent JDBC and IBM Informix isolation levels
JDBC value IBM Informix isolation level
java.sql.Connection.TRANSACTION_SERIALIZABLE Repeatable read
java.sql.Connection.TRANSACTION_REPEATABLE_READ Repeatable read
java.sql.Connection.TRANSACTION_READ_COMMITTED Committed read
java.sql.Connection.TRANSACTION_READ_UNCOMMITTED Dirty read
com.ibm.db2.jcc.DB2Connection.TRANSACTION_IDS_CURSOR_STABILITY IBM Informix cursor stability
com.ibm.db2.jcc.DB2Connection.TRANSACTION_IDS_LAST_COMMITTED Committed read, last committed