aspose file tools*
The moose likes JDBC 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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL/SQLJ with Transaction Isolation over JDBC" Watch "SQL/SQLJ with Transaction Isolation over JDBC" New topic
Author

SQL/SQLJ with Transaction Isolation over JDBC

Faisal Fuad
Ranch Hand

Joined: Jul 05, 2011
Posts: 79

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.

Regards

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