It is called a Transaction. See the following:
Using Transactions (The Java™ Tutorials > JDBC(TM) Database Access > JDBC Basics)