Link to home
Start Free TrialLog in
Avatar of LeTay
LeTay

asked on

DB2 isolation level with JDBC

What are the way(s) to change the isolation level accessing a DB2 database via the JDBC driver ?
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

you can either change the isolation property at the connection method, and this isolation will hold for every statement you execute, or you can change the isolation level at the statement level by adding with XX at the end of the statement, for example

select * FROM mytable with CS
select * from mytable with UR
Avatar of LeTay
LeTay

ASKER

I was told that I can also change the db2cli.ini file
Is this true ?
What do I have to put there ?
Do you have a sample ?
Avatar of LeTay

ASKER

I forgot to mention : the application can access DB2 or Oracle or mySQL (depends on our customer needs) so better to have the isolation level specified "outside" the code of the application
Avatar of Kent Olsen
Hi LeTay,

Depending on the client that you're using to access DB2, you can also change the default isolation level.

  SET ISOLATION LEVEL UR/CS/etc.


Kent
Avatar of LeTay

ASKER

We use JDBC
I think that I have to modify db2cli.ini
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial