Quantcast
Channel: Foro de SQL Server Data Access
Viewing all articles
Browse latest Browse all 158

how to set Auto Commit for SQL Server 2008 with JDBC 2.0?

$
0
0
In Java code, a sql string generated dynamically in code like:
String sqlstring ="Update tab1 set ....    update tab2 set ....."
When execute the sqlstirng using prepareStatement and executeUpdate, JDBC driver 2.0 treat this execution as two transactions. It means Auto Commit =  ture.
But I want to the sqlstring execution is treated as one transaction without code changs. I think there should be a setting for this issue but I am not sure where to set it. In JDBC conncetion string? in Database ?

When using SQL server 2000 with JDBC 1.0, the sqlstring execution is treated as on transaction. When move the database to SQL server 2008 instance and using JDBC 2.0, it seems not working any more.

Help please.

Viewing all articles
Browse latest Browse all 158

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>