Hi - I was asked the following question on a test taken as part of a recruitment process. What do you guys think? Q: To code a JDBC transaction, a developer invokes the commit and rollback methods of the __________ interface. Choices: 1) java.sql 2) javax.Connection 3) javac.sql.Connection 4) javax.sql.Connection Regards, Guy
Swamy Vatti
Ranch Hand
Joined: May 02, 2001
Posts: 57
posted
0
its option 4 javax.sql.Connection
Swamy
Ming Chen
Greenhorn
Joined: Mar 14, 2002
Posts: 13
posted
0
Why it's not number 1. Is javax.sql a new API package or it's just your own package.
"Ming", your name does not conform to the JavaRanch naming policy. I have previously asked you to change your name (here). Please make sure you change your name otherwise we will have to lock the account. Thanks, Dave.
You sure its not a typo for java.sql.Connection instead of javax or javac? (available here) Dave
Guy Allard
Ranch Hand
Joined: Nov 24, 2000
Posts: 776
posted
0
Hi Dave - I think it is either a typo, or one of those questions where the answer is 'none of the above'. Regards, Guy
Craig Demyanovich
Ranch Hand
Joined: Sep 25, 2000
Posts: 173
posted
0
According to the javadoc, commit() and rollback() are implemented in java.sql.Connection. Distributed transactions, however, are supported in javax.sql via the XAConnection and XADatasource interfaces. Hence, the question is flawed. Craig [ March 20, 2002: Message edited by: Craig Demyanovich ]
Rather than imply that the question is "tricky," I would speculate that an error was made in providing the multiple choice answers. To more clearly state the point I tried to make in my earlier post, basic transactional support is provided in java.sql.Connection via commit() and rollback(). Distributed transactions are supported via javax.sql.XADatasource and javax.sql.XAConnection. The question doesn't distinguish the type of transactions; thus, I believe that answer D would be the correct one if not for a typo. Craig