• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion in a question from Ganesh/Sharma book

 
Alex Benedict
Greenhorn
Posts: 16
Chrome Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellow rachers,

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.
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

See reference setSavepoint that states
Throws:
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





Best regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic