Share on Google+Share on Google+

Nagendran
define transactions
1 Answer(s)      4 years and 11 months ago
Posted in : JDBC

define transactions

Ads

View Answers

May 9, 2012 at 4:41 PM


Whenever a connection is created by using the JDBC, then by default it is in auto- commit mode. This means that SQL statement will be automatically committed immediately after it is executed and it is treated as a transaction. But imagine a situation where you want to execute a batch of statements, either they should commit at on go or they should get failed together. For this we need to disable the auto- commit mode by using the method:

con.setAutoCommit(false).

After setting the auto- commit as false, no SQL statement will be committed until we call the con.commit() method. If there arises any problem while committing then the set of statements will be rollback, without committing.










Related Tutorials/Questions & Answers:
managing the transactions
should i write in EJB (i am using SEAM) to manage the transactions
a class named Transactions
a class named Transactions  Write this java code for me: a class named Transactions that holds the memo and the amount of a transaction. Prompt the user for the number of transactions and create a new Transaction object
Advertisements
Chapter 11. Transactions
;TransactionsIdentify correct and incorrect statements or examples about EJB transactions... transactions. The Enterprise JavaBeans architecture allows an application... (BMT) demarcation, the enterprise bean code demarcates transactions using
Define HibernateTemplate?
Define HibernateTemplate?  Hi, Define HibernateTemplate? Thanks
Define stack
Define stack  hii, Explain stack
Define please!?!
Define please!?!  What is tree map sort
define a constant.
define a constant.  How do you define a constant?   Hi, With the help of define() directive, you can create constant in php. And here is how: <?php define('NAME', 'Bharat'); ?> Thanks
Chapter 5. EJB transactions
transactions Build EJBs which satisfy transactional requirements EJB transactions are a set of concepts and a set... transactions; the container must do everything. Therefore, if your transaction
Define Simulation
Define Simulation  hello,, Explain Simulation?   hii, Simulation is the process of forming an abstract model from a real situation in order to understand the impact of modifications and the effect of introducing
Define stack
Define stack  hii, Explain stack?   hello, Stack is an ordered list in which all the insertions and deletions made at one end called top of the stack. It is referred as LIFO list. Last inserted item is deleted First
Define hiberanate
Define hiberanate  What is Hibernate?   Hibernate is a pure java ORM (object-relational mapping) and persistence framework that allows you to map POJO (Plain Old Java Obiect) to relational database tablea using(XML
Creating Hibernate Sessions and Transactions through Spring - AOP .
Creating Hibernate Sessions and Transactions through Spring - AOP .  ... and Transactions using Spring-AOP. Can you provide a sample code where Hibernate Sessions and Transactions are created using Spring-AOP when the control flows
Creating Hibernate Sessions and Transactions through Spring - AOP .
Creating Hibernate Sessions and Transactions through Spring - AOP .  ... and Transactions using Spring-AOP. Can you provide a sample code where Hibernate Sessions and Transactions are created using Spring-AOP when the control flows
Creating Hibernate Sessions and Transactions through Spring - AOP .
Creating Hibernate Sessions and Transactions through Spring - AOP .  ... and Transactions using Spring-AOP. Can you provide a sample code where Hibernate Sessions and Transactions are created using Spring-AOP when the control flows
Creating Hibernate Sessions and Transactions through Spring - AOP .
Creating Hibernate Sessions and Transactions through Spring - AOP .  ... and Transactions using Spring-AOP. Can you provide a sample code where Hibernate Sessions and Transactions are created using Spring-AOP when the control flows
Creating Hibernate Sessions and Transactions through Spring - AOP .
Creating Hibernate Sessions and Transactions through Spring - AOP .  ... and Transactions using Spring-AOP. Can you provide a sample code where Hibernate Sessions and Transactions are created using Spring-AOP when the control flows
Define the session factory interface in hibernate?
Define the session factory interface in hibernate?  Define the session factory interface in hibernate?   Session factory is used... that is reusable between transactions at a process, or cluster
php define variable
php define variable  How to define a simple and a global variable in PHP
php define array
php define array  How to define array in PHP
define string variable in php
define string variable in php  how to define string variable in PHP
define a constant in php
define a constant in php   hii, How do you define a constant in php?   hello, we can define a constant in php like this define ("CONST", 50
Define computer software.
Define computer software.  How to define a computer software?   A computer software is a set of instruction that tell the computer what to do
user define exception programs
user define exception programs  user define exception programs   Please visit the following links: http://www.roseindia.net/java/java-exception/user-defined-exception.shtml http://www.roseindia.net/java/exceptions
Define float in Java
Define float in Java  Hi, What is the correct method to define... JavaFloatExample { /* Learn How to define and use float variable in Java...); } } Thanks  public class JavaFloatExample { /* Learn How to define
objective c define float
objective c define float  Hi, How to define float variable in objective c? Thanks   Hi, Here is the example of defining float variable. float i; i=10; Thanks   Hi, Here is another example: // File
Define Tag:
Define Tag:       bean:define Tag - is used to define a scripting variable based on the value(s) of the specified bean... as null. bean:define Tag can't be used  to instantiate a DynaActionForm
When will you define a method as static?
When will you define a method as static?  Hi, When will you define a method as static? thanks
How do you define a constant?
How do you define a constant?  How do you define a constant in php
need complete jsp code for transactions using mysql - WebSevices
need complete jsp code for transactions using mysql  iam doing online banking project.i want the code to transfer funds from one account to another... to lasya or lasya to prathika. I need complete jsp code for transactions using
How to define a constant variable in Java?
How to define a constant variable in Java?   Hi, How to define a constant variable in Java? thanks   HI, The Constants variables are declared using the final keyword. The values of the constant can't be changed
import user-define package - Applet
import user-define package  how to import user-define package to the frame/graphic of the applet. could i create a new frame or not ?? please help me ...  Hi friend, import java.io.*; import java.awt.*; import
Tutorials   
Java Spring Hibernate Struts Training how to retrieve text and images from mysql database and show on html page using jsp servlet How to install Neo4j on Ubuntu 15.10? please help me in these prog MYSQL - mysql copy table to another table example by creating new table solution for mapping hibernate and pojos from net beans through database Connect GWT application with Oracle inventory System of Medical Store inventory System of Medical Store inventory System of Medical Store inventory System of Medical Store This code have created jTable that connected with a database.every cell of last column have a button.But this button doesn't work properly.Where is the error java program Java Database Program jdbc Database connection class in a live project ..?? What is JDBC architecture? Unable to Create DSN for excel to ms access importing data and edit that data Database Scrolling Buttons how to use foreign key in java How to delete content of a log file from linux terminal? JSP-Oracle connectivity Student Management System Java code for Saving Marathi (Indian local language ) in Mysql and retrieving the same crud operations with foreign key constraint. I really need help with this assignment question Please help me out Please Backup Failed Mysqldump Got Errno 28 On Write Upgrade MySQL 5.1 to 5.5 in cpanel mysqldump all databases com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist persistence xml class element persistence.xml for MySQL MySQL JDBC Driver pom dependency code Blob column jdk6 and oracle 8i connexion oracle 8i et jdk6 java [ cannot retrive date from sql ] why?? Order Entry System How to threow timeout exception when DB is not responding How to threow timeout exception when DB is not responding This is the employee form to add data to mysql database but I got error of NullPointerException, Is this write code please give me feedback as soon as possible make a method which takes user name & pwd as parameter & validate them against the database. If the corresponding user exist return true otherwise false. prabhakar validating credentials and displaying error message in login .jsp if not valid JDBC jdbc jdbc code register servlet vibhu connectiondetails from vibhu

Ads

 
Advertisement null

Ads