대상쿼리문 insert, update, delete
구성된 모든 쿼리문이 정상적으로 수행되면 commit으로 Transaction이 완료되고, 쿼리문이 비 정상적으로 수행되었다면 rollback으로 Transaction을 취소해야한다.
단일 쿼리문으로 Transaction이 구성되는 경우는 autocommit을 수행하는 것이 편리.
Connection은 autoCommit(true)가 기본 설정이므로 query문 하나로 Transaction이 구성된다.
작성법 )
con.setAutoCommit(true);// true - autocommit, false - autocommit 해제
public int method(){
쿼리문 1
int 수행행수
쿼리문 2
int 수행행수
return 모든수행행수;
// 쿼리문 1 , 쿼리문 2 : 쿼리문을 실행하기 위한 쿼리문 생성객체를 여러개 얻어 사용.
}
int cnt = method();
try{
if( cnt목표로한 행수?){
con.commit();
}else{
con.rollback();
}catch(SQLException se){
con.rollback();
}

con : Connection
transaction() : int
useTransaction() : void
여러 개의 insert가 하나의 Transaction으로 구성 될 때에는 commit 또는 Exception으로 처리한다. (catch 안에서 rollback 수행)
여러 개의 update나 delete로 Transaction이 구성될 때에는 if ~else로 commit과 rollback을 처리한다. (catch안에서도 rollback을 수행한다.)
일관성 : Transaction에 포함된 데이터는 모두 기록되든, 모두 기록되지 않든 일관성있게 동작을 해야한다.

<!DOCTYPE html>
<html>
<head>
<title>타이틀바에 들어갈 내용</title>
</head>
<body>
사용자에게
</body>
</html>