This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Urgent - Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Urgent - Transaction" Watch "Urgent - Transaction" New topic
Author

Urgent - Transaction

Snigdha Solanki
Ranch Hand

Joined: Sep 07, 2000
Posts: 128
In sybase (TSQL),"BEGIN TRANSACTION" and "COMMIT TRANSACTION" is used for transaction control.
Are these two statements valid for Oracle, Informix or any other DB also?
Actually the problem is that for managing transcations I was using JDBC methods - setAutoCommit(),rollback() and commit(). But it caused some conflict with stored procedure setting. The DBA is asking me to use "BEGIN TRANSACTION" and "COMMIT TRANSACTION" instead.
Statement.executeUpdate("BEGIN TRANSACTION");
But will this not make by code Database dependent? The advantage of using JDBC is that you can change the DB layer without affecting the code. I am not sure but if I put these statements in my code, will it not make it sybase specific?
I will appreciate an early reply on this.
[ September 04, 2002: Message edited by: Snigdha Solanki ]
[ September 04, 2002: Message edited by: Snigdha Solanki ]

Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform
David Gilmore
Greenhorn

Joined: Jul 19, 2002
Posts: 9
I'm afraid much Transaction management is Sybase specific. For example, Oracle transaction management is provided mainly through the two SQL statements: COMMIT and ROLLBACK. Other commands related to transaction management include: SAVEPOINT, SET TRANSACTION, and SET AUTOCOMMIT.
Oh, the problems of portability!


There are 10 types of people in this world - those who understand binary and those who don't.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent - Transaction