Setting and rolling back to a savepoint

The JDBC 3.0 API adds the method Connection.setSavepoint, which
sets a savepoint within the current transaction. The Connection.rollback method
has been overloaded to take a savepoint argument. See java.sql.Connection for
more information.

The code example below inserts a row into a table, sets the savepoint svpt1,
and then inserts a second row. When the transaction is later rolled back to svpt1,
the second insertion is undone, but the first insertion remains intact. In
other words, when the transaction is committed, only the row containing '1'
will be added to TABLE1.