Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC You handle your own transaction

Have Programming Question? Ask it here!
 
 
 


Clark
You handle your own transaction
1 Answer(s)      3 years and 9 months ago
Posted in : JDBC


How do you handle your own transaction ?


Advertisement
View Answers

November 12, 2010 at 5:34 PM


Hi friends,

Connection Object has a method called setAutocommit(Boolean istrue) - Default is true. Set the Parameter to false, and begin your transaction Example:

Connection con = getConnection();

con.setAutocommit(false);

//other code

con.commit();

con.close();

Thanks.



Related Tutorials/Questions & Answers:
You handle your own transaction
You handle your own transaction  How do you handle your own transaction
Importing Your Own Package
Importing Your Own Package  I would like to know if it is possible to create a class with your own methods so that you can import them when writing programs
Advertisements
Java transaction
Java transaction  How do you handle your own transaction
How to handle Transaction IN and OUT in Inventory using java
How to handle Transaction IN and OUT in Inventory using java  Hi... automatically on load. This is the process for Transaction IN. We scan the items again... dt.of.out transaction,90 respectively. This is the process of OUT Transaction
Creating your own package in java
the real classes in the package. To know more about how to create own package and subpackage click on the following links Create Your Own Package Create
Create your own Notepad in Java
Create your own Notepad in Java           You must have worked with Notepad to write programs. Now its turn to create notepad by own with the help of java language
Transaction
the transaction so I need to use the TransactionProxyFactoryBean. My question is that can I use the advice as well as the spring provided transaction in the same person bean as a AOP. I don't want to write the code for transaction, just want
What is "Bring Your Own Device" (BYOD)?
What is "Bring Your Own Device" (BYOD)? Bring your own device or as commonly... of desktops all over the world in an unprecedented way. By referring to bring your own... is referred as bring your own device or BYOD policy. Here we would see various
How can you handle form in Spring 3.2 MVC?
How can you handle form in Spring 3.2 MVC?  Hi, How can you handle... the How can you handle form in Spring 3.2 MVC?   Hi, This article.... For more please visit the How can you handle form in Spring 3.2 MVC
Hibernate Transaction
Hibernate Transaction In this tutorial you will learn about the Transaction in Hibernate. In transaction multiple operations are gathered into a single unit... code as example that will demonstrate how may you use the Hibernate Transaction
Website Development Applications ? Design Your Own Website At The Drop Of A Hat
you can get started on your own. Easy to use templates Even with the basics.... This will provide the basic structure that you can use. You just have to add your own text... will have your own website up and running. You can see the benefits that website
how can you calculate you your age in daies??
how can you calculate you your age in daies??  **hi, I am beginner... of your date of birth: "); int day=input.nextInt(); System.out.print("Enter month(in number) of your date of birth: "); int month
What would you rate as your greatest weaknesses?
What would you rate as your greatest weaknesses... imbalances in your personal life. It is also possible that they are assessing how you... this question. (This gives the impression that you are searching your memory for some
When you look back on the position you held last, do you think you have done your best in it?
; If you say that you did, it could mean that your best is already... don’t give your all to the work at hand. You should therefore indicate that you always put in your best efforts. Also show that this time of your career
what is Set Transaction?
your current transaction, not other users or other transactions. Your transaction ends whenever you issue a COMMIT or ROLLBACK statement. Thanks...what is Set Transaction?  what is Set Transaction?   Hi
Commiting and Rolling Back transaction
call  conn.commit();. If any error occurs you can roll back your transaction...; } Rolling Back Transaction When you do any operation such as , SELECT... one transaction at a time you need to set connection object auto-commit(false
Transaction Management
Transaction Management  How are transactions managed in EJB
Would you initialize your strings with single quotes or double quotes?
Would you initialize your strings with single quotes or double quotes?  Would you initialize your strings with single quotes or double quotes
Distributed transaction in java
-small; text-decoration: underline; } Distributed Transaction in java EE In distributed java enterprise application, transaction is processed by Transaction Manager. Transaction manager is the primary component of distributed
Turning transaction off and on
; } Turning Committing Transaction Off and On When you do any operation such as , SELECT, INSERT, DELETE, or UPDATE  in database then the transaction.... To commit more than one transaction at a time you need to set connection object
Create Your Own Package
Create Your Own Package      ... HelloWorld.java Run the program. If you try to run this program, you...: Compile in the same directory:  If you have a hierarchy
Your competitor presses you to reveal some confidential information about your current or previous employer.
Situation: Your competitor presses you to reveal some confidential... placed on you, just as the interviewer would expect their own employees to behave while talking with their competitors. Whenever your own achievements have
Java eft transaction
testing. When your Card processor is tested by running the Transaction Processor...(TranReq) method. This method receives a transaction request. Your implementation... of a particular type (savings, current, credit). ? A transaction request
JDBC Transaction Example
; } JDBC Transaction Example JDBC Transaction  JDBC transaction... successfully. When  you create a connection using JDBC, by default it is in auto-commit mode and  each SQL statement is treated as transaction
I think you should be earning more money at this point of your career. Why isn?t it happening?
I think you should be earning more money at this point of your career. Why... negotiating your salary. However your answer should explain why you are earning something below the industry standards. Your answer should state that you do like
Hibernate 4.0-nested transaction not suported
Hibernate 4.0-nested transaction not suported  how i do nested transaction using Hibernate 4, i know hibernate 4 does not support nested transaction. Is there any way to do nested transaction like inserting more than one record
Hibernate 4.0-nested transaction not suported
Hibernate 4.0-nested transaction not suported  how i do nested transaction using Hibernate 4, i know hibernate 4 does not support nested transaction. Is there any way to do nested transaction like inserting more than one record
How to Handle Event Handlers?
How to Handle Event Handlers?  How to Handle Event Handlers
Keep Your Current Job While You Seek a New One
Keep Your Current Job While You Seek a New One  ... well as long as you are in your current job. Here are a few things that could... and to whom you are sending your resume. Some job portals have the option
Could not open JPA EntityManager for transaction
following error: Could not open JPA EntityManager for transaction; nested...; Hi, You application is not able to get the database connection. Check if your application is consuming large number of database connection. Thanks
How would you honestly evaluate the strengths and weaknesses of your previous/current company/boss/team?
How would you honestly evaluate the strengths and weaknesses of your... deal with a situation like this. You might be really tempted to unburden your soul... points. Remember, your loyalty is coming under scrutiny here. If you criticize
Java User Transaction. - Java Beginners
Java User Transaction.  Hi Experts, Could you please guide me for writing a java program of File Handling using user transaction, also please tell me which jars do I need. Please give me a program for above mentioned
Web Page Transaction
Web Page Transaction  Hello sir, i want to add an Effective page transaction when i go to my home page to other page in js...plllzzz help me...rppy soon
iphone handle orientation change
iphone handle orientation change   How can i handle the orientation change in iPhone / iPad application? Please suggest. Thank in Advance
Transaction in last 3 months
Transaction in last 3 months  I have a project in which i have to calculate amount submitted through transactions in last three months. I have to check the date of all transactions in past 90 days and add the total amount
java exception handle
java exception handle  How error can be handled in the exception class?? can we handle fatal error in java
JDBC Transaction ACID property
.style1 { text-align: center; } JDBC Transaction ACID Property A Transaction is a unit of work performed on the database and treated in a reliable way independent of other transaction. In database transaction processing ACID
JSP handle runtime exceptions
JSP handle runtime exceptions  How does JSP handle runtime exceptions?   Using errorPage attribute of page directive and also we need to specify isErrorPage=true if the current page is intended to URL redirecting
How to handle enter key in javascript
How to handle enter key in javascript  Can any one tell me how to handle the enter key event on a Button in HTML. Like in my simple HTML page i want... of button.   Enter key event in html JavaScript This is very simple. You
What is a transaction and what are ACID properties?
What is a transaction and what are ACID properties?  What is a transaction and what are ACID properties
how to handle MySQLIntegrityConstraintViolationException?
how to handle MySQLIntegrityConstraintViolationException?  Cannot add or update a child row: a foreign key constraint fails (outerdb.outerpatient, CONSTRAINT outerpatient_ibfk_1 FOREIGN KEY (xrayno) REFERENCES xray (xrayno
Sorting Arrays
Java NotesSorting Arrays Why you shouldn't write your own sort A favorite... efficient, more general, and more correct than anything you are likely to write... of the java.util.Arrays.sort() methods; they do not write their own, except perhaps
class with in its own objects?
class with in its own objects?  Is it a good idea to declare a class with in its own objects
Own tag in XML
Own tag in XML  Hi.... Does XML let me make up my own tags? please anyone give the answer Thanks
Use JTA to control transaction demarcation
-managed transactions. When you code a bean-managed transaction for session... Use JTA to control transaction...; Use JTA to control transaction demarcation
Creating own Interceptor
Creating own Interceptor Though Interceptors are provided by default in the stack, one can also create custom interceptors and add it to already existing list of interceptors. It is very easy to create your own interceptor. Custom made
Making own SDK - MobileApplications
Making own SDK  Hi all, I am trying to make my own universal installer for installing the JavaME mobile application to all the phones supports java.For this where from i start to think
Struts2.2.1 handle multiple Submits in your application
Struts2.2.1  handle multiple Submits in your application  ...; </head> <body> Thank you. We will ship your.... The following Example will shows how to handle the multiple Submits in the Struts2.2.1
JSP handle run-time exceptions
JSP handle run-time exceptions  How does JSP handle run-time exceptions?   You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing
How to handle the text using Key Listener Interface
How to handle the text using Key Listener Interface       In this section, you will learn how to handle the text using the key events on the Java Awt component. All the key events
 

 

 

DMCA.com