Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Overview of this book

Table of Contents (20 chapters)
JDBC 4.0 and Oracle JDeveloper for J2EE Development
Credits
About the Author
About the Reviewer
Preface

Savepoint Interface


Savepoint is a new interface in JDBC 3.0 specification. A Savepoint is a point within a transaction up to which the changes made in the transaction are rolled back, if the transaction is rolled back with the rollback() method. All changes before the savepoint are implemented when a transaction is rolled back. A savepoint is set with the overloaded setSavepoint() method:

Savepoint savepoint=connection.setSavepoint();
Savepoint savepoint=connection.setSavepoint("savepointName");

The getSavepointId() method returns the savepoint id, and the getSavepointName() method returns the savepoint name.