Stay organized with collections
Save and categorize content based on your preferences.
Savepoint
public
interface
Savepoint
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.
Summary
Public methods |
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
getSavepointId
public abstract int getSavepointId ()
Retrieves the generated ID for the savepoint that this
Savepoint
object represents.
Returns |
int |
the numeric ID of this savepoint |
getSavepointName
public abstract String getSavepointName ()
Retrieves the name of the savepoint that this Savepoint
object represents.
Returns |
String |
the name of this savepoint |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-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 2025-02-10 UTC."],[],[],null,["# Savepoint\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nSavepoint\n=========\n\n\n`\npublic\n\n\ninterface\nSavepoint\n`\n\n\n`\n\n\n`\n\n|--------------------|\n| java.sql.Savepoint |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\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\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[getSavepointId](/reference/java/sql/Savepoint#getSavepointId())`() ` Retrieves the generated ID for the savepoint that this `Savepoint` object represents. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getSavepointName](/reference/java/sql/Savepoint#getSavepointName())`() ` Retrieves the name of the savepoint that this `Savepoint` object represents. |\n\nPublic methods\n--------------\n\n### getSavepointId\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int getSavepointId ()\n```\n\nRetrieves the generated ID for the savepoint that this\n`Savepoint` object represents.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|-----------------------------------------|\n| `int` | the numeric ID of this savepoint \u003cbr /\u003e |\n\n| Throws ||\n|--------------------------------------------------|------------------------------|\n| [SQLException](/reference/java/sql/SQLException) | if this is a named savepoint |\n\n### getSavepointName\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getSavepointName ()\n```\n\nRetrieves the name of the savepoint that this `Savepoint`\nobject represents.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-----------------------------------|\n| [String](/reference/java/lang/String) | the name of this savepoint \u003cbr /\u003e |\n\n| Throws ||\n|--------------------------------------------------|----------------------------------|\n| [SQLException](/reference/java/sql/SQLException) | if this is an un-named savepoint |"]]