*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes confusion in a question from Ganesh/Sharma book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "confusion in a question from Ganesh/Sharma book" Watch "confusion in a question from Ganesh/Sharma book" New topic
Author

confusion in a question from Ganesh/Sharma book

Alex Benedict
Greenhorn

Joined: Apr 12, 2013
Posts: 16

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

Joined: Apr 19, 2013
Posts: 199
    
    1
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,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: confusion in a question from Ganesh/Sharma book
 
Similar Threads
Error in row
Error in row!!!
Exception while inserting a row with resultSet.insertRow()
Error while setting save point in connection object
ClassNotFoundException