Core Java Tutorials


Introduction

Java Hello World

Java Compilation

JDK New Features

JVM Architecture

Java OOPs Concepts

Java Package

Array

Exception Handling

String

Immutable Class

File Handling

Serialization

MultiThreading

Volatile

Concurrent Package

Collection

Collection Internal

Generics

Cloning

Reflection In Java

Annotation

Class Loader

Java Inner classes

Garbage Collector

JDBC

References In Java

Heap Dump & Thread Dump

/java/transactions-in-jdbcPrevious             Next

Transactions in JDBC

Transaction Management in java is required when we are dealing with relational databases.We use JDBC API for database operations and today we will learn how to use JDBC transaction management.

Transaction Management in Java JDBC

By default when we create a database connection, it runs in auto-commit mode. It means that whenever we execute a query and it's completed,the commit is fired automatically.So every SQL query we fire is a transaction and if we are running some DML or DDL queries,the changes are getting saved into database after every SQL statement finishes.

Disabling Auto-Commit Mode
Committing Transactions
Using Transactions to Preserve Data Integrity
Setting and Rolling Back to Savepoints
Releasing Savepoints
When to Call Method rollback

Disabling Auto-Commit Mode

/java/transactions-in-jdbcPrevious             Next