jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes SQL/SQLJ with Transaction Isolation over JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQL/SQLJ with Transaction Isolation over JDBC" Watch "SQL/SQLJ with Transaction Isolation over JDBC" New topic

SQL/SQLJ with Transaction Isolation over JDBC

Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 83

Hi all...I have seen in SQL/SQLJ people do implement different Isolation Levels in their various Queries. But what I want to do is keep the query as simple as it can be but will implement the isolation level while committing any transaction in my code. Is that possible? For an instance, lets say my background DB is DB2. Please suggest me the best option here.


Note: I want this to happen because suppose I do have n-numbers of queries for my application (already written). And now if I want to manually implement isolation for each query (i.e., say by adding "WITH UR" at the end of each query) then for sure that will be very troublesome -right? Let me present one sample JDBC/MySQL example to elaborate:

a) Will define the necessary variables as follows:

b) Getting Connection and Query

c) Execute the Query <-----But here is the problem. I just don't want to write as follows:

Rather, I want to add Isolation Level with each query (at the end), while going to comit any specific transaction. But how? I was thinking about String concatination but as I saw some classes are available in .NET platform therefore was thinking may be Java will have similear something like that.

Hope I could explain my situation clearly
I agree. Here's the link: http://aspose.com/file-tools
subject: SQL/SQLJ with Transaction Isolation over JDBC
It's not a secret anymore!