• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transactions

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By using JDBC how can we execute more thatn 1 query in 1 transaction.
It has been asked by an interviewer. Please share your views. Thanks.
Shreya
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What database? Is it query or DML statements? What Driver (XA or Non-XA)?
If it is DML statement and non XA driver then you need to disable "auto commit" option in the connection.


and then finally decide to either call commit() or rollback() before closing the connection.
 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Database is oracle
 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does it mean XA or NON XA. And what will happen if it DDL commands
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is trivial, and if you don't know the answer then you shouldn't apply for a job that requires knowledge of JDBC.
 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I am still studying java& JDBC concepts. I got this question from my friend.
Please feel free and explain me about this in detail.
This site is for to support people I guess no matter what.
 
stu derby
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ranga shreya:
Actually I am still studying java& JDBC concepts. I got this question from my friend.
Please feel free and explain me about this in detail.
This site is for to support people I guess no matter what.



You and your friend need to learn how to use Google. A search for "jdbc transactions" has the answer in plain simple terms on about every 4th or 5th page.

However, you obviously need to start with the basics (where this is well covered).

http://java.sun.com/docs/books/tutorial/jdbc/index.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic