This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Transactions" Watch "Transactions" New topic
Author

Transactions

ranga shreya
Greenhorn

Joined: Mar 05, 2005
Posts: 20
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


Thanks,<br />Ranga.<br />Life is precious so enjoy the life each moment and utilise it at the same time.
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
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

Joined: Mar 05, 2005
Posts: 20
Database is oracle
ranga shreya
Greenhorn

Joined: Mar 05, 2005
Posts: 20
What does it mean XA or NON XA. And what will happen if it DDL commands
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
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

Joined: Mar 05, 2005
Posts: 20
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

Joined: Dec 15, 2005
Posts: 333
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transactions
 
Similar Threads
Portal and portlet developement forum
Are there any Parsi guys on JR?
count yourself in javaranch#~
How many rotations...
0 or 1