Savepoint
Stay organized with collections
Save and categorize content based on your preferences.
The representation of a savepoint, which is a point within
the current transaction that can be referenced from the
Connection.rollback
method. When a transaction
is rolled back to a savepoint all changes made after that
savepoint are undone.
Savepoints can be either named or unnamed. Unnamed savepoints
are identified by an ID generated by the underlying data source.
Public Method Summary
abstract
int
|
getSavepointId()
Retrieves the generated ID for the savepoint that this
Savepoint object represents.
|
abstract
String
|
getSavepointName()
Retrieves the name of the savepoint that this Savepoint
object represents.
|
Public Methods
public
abstract
int
getSavepointId
()
Retrieves the generated ID for the savepoint that this
Savepoint
object represents.
Returns
- the numeric ID of this savepoint
public
abstract
String
getSavepointName
()
Retrieves the name of the savepoint that this Savepoint
object represents.
Returns
- the name of this savepoint
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eA Savepoint represents a point in a transaction that can be used to rollback changes made after that point.\u003c/p\u003e\n"],["\u003cp\u003eSavepoints can be named using a string or unnamed with a system-generated ID.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetSavepointId()\u003c/code\u003e method retrieves the ID of an unnamed savepoint and throws an exception if called on a named savepoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetSavepointName()\u003c/code\u003e method retrieves the name of a named savepoint and throws an exception if called on an unnamed savepoint.\u003c/p\u003e\n"]]],[],null,["# Savepoint\n\npublic interface **Savepoint** \nThe representation of a savepoint, which is a point within\nthe current transaction that can be referenced from the\n`Connection.rollback` method. When a transaction\nis rolled back to a savepoint all changes made after that\nsavepoint are undone.\n\n\nSavepoints can be either named or unnamed. Unnamed savepoints\nare identified by an ID generated by the underlying data source. \n\n### Public Method Summary\n\n|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [getSavepointId](../../../reference/java/sql/Savepoint.html#getSavepointId())() Retrieves the generated ID for the savepoint that this `Savepoint` object represents. |\n| abstract [String](../../../reference/java/lang/String.html) | [getSavepointName](../../../reference/java/sql/Savepoint.html#getSavepointName())() Retrieves the name of the savepoint that this `Savepoint` object represents. |\n\nPublic Methods\n--------------\n\n#### public abstract int\n**getSavepointId**\n()\n\nRetrieves the generated ID for the savepoint that this\n`Savepoint` object represents. \n\n##### Returns\n\n- the numeric ID of this savepoint \n\n##### Throws\n\n| [SQLException](../../../reference/java/sql/SQLException.html) | if this is a named savepoint |\n|---------------------------------------------------------------|------------------------------|\n\n#### public abstract [String](../../../reference/java/lang/String.html)\n**getSavepointName**\n()\n\nRetrieves the name of the savepoint that this `Savepoint`\nobject represents. \n\n##### Returns\n\n- the name of this savepoint \n\n##### Throws\n\n| [SQLException](../../../reference/java/sql/SQLException.html) | if this is an un-named savepoint |\n|---------------------------------------------------------------|----------------------------------|"]]