1. /*
  2. * @(#)Savepoint.java 1.9 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.sql;
  8. /**
  9. * The representation of a savepoint, which is a point within
  10. * the current transaction that can be referenced from the
  11. * <code>Connection.rollback</code> method. When a transaction
  12. * is rolled back to a savepoint all changes made after that
  13. * savepoint are undone.
  14. * <p>
  15. * Savepoints can be either named or unnamed. Unnamed savepoints
  16. * are identified by an ID generated by the underlying data source.
  17. *
  18. * @since 1.4
  19. */
  20. public interface Savepoint {
  21. /**
  22. * Retrieves the generated ID for the savepoint that this
  23. * <code>Savepoint</code> object represents.
  24. * @return the numeric ID of this savepoint
  25. * @exception SQLException if this is a named savepoint
  26. * @since 1.4
  27. */
  28. int getSavepointId() throws SQLException;
  29. /**
  30. * Retrieves the name of the savepoint that this <code>Savepoint</code>
  31. * object represents.
  32. * @return the name of this savepoint
  33. * @exception SQLException if this is an un-named savepoint
  34. * @since 1.4
  35. */
  36. String getSavepointName() throws SQLException;
  37. }