I am reading Ganesh/Sharma book for my OCPJP 7 preparation. I found the following question which I could not understand. I am seeking help here. It is on page 29-30 in chapter 2(pre-test).
35. Consider the following sequence of statements when using JDBC API. Assume that you’ve a TempSensor table with the column name temp.
Which one of the following options correctly describes the behavior of this program?
a) temp value will be set to "100" in the table TempSensor.
b) temp value will be set to "200" in the table TempSensor.
c) temp value will be set to "300" in the table TempSensor.
d) temp value will be set to "0" in the table TempSensor.
e) The program will result in throwing a SQLException because auto-commit is true.
The book says e) is the answer.
Thanks in advance.
posted 2 years ago
See reference setSavepoint that states
SQLException - if a database access error occurs, this method is called while participating in a distributed transaction, this method is called on a closed connection or this Connection object is currently in auto-commit mode