This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

A Connection question  RSS feed

 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its option 4
javax.sql.Connection
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why it's not number 1.
Is javax.sql a new API package or it's just your own package.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Swamy Vatti:
its option 4
javax.sql.Connection


Swamy's got it.
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really guys?
Please give me a link to a Sun API doc page that shows the interface javax.sql.Connection.
Guy
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You sure its not a typo for java.sql.Connection instead of javax or javac? (available here)
Dave
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave - I think it is either a typo, or one of those questions where the answer is 'none of the above'.
Regards, Guy
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah ha, a trick question.
Thanks, Craig
 
Craig Demyanovich
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!