package com.github.fjdbc.op;

import java.sql.Connection;
import java.sql.SQLException;

import com.github.fjdbc.ConnectionProvider;
import com.github.fjdbc.RuntimeSQLException;

/**
 * Represent a database operation that modifies rows: insert, update, delete, etc.
 */
public interface DbOperation {
	/**
	 * Execute the operation, leaving the connection open.
	 * 
	 * @return The number of modified rows.
	 */
	int execute(Connection connection) throws SQLException;

	/**
	 * Executes the following steps:
	 * <ul>
	 * <li>execute the operation.
	 * <li>commit.
	 * <li>In case of exception, rollback.
	 * </ul>
	 * The method {@link ConnectionProvider#giveBack} is called at the end.
	 * 
	 * @return The number of modified rows.
	 * @throws RuntimeSQLException
	 *             if a {@link SQLException} occurs.
	 */
	int executeAndCommit();
}
@@ -267,18 +267,193 @@
 te, etc.
+ It can be made of a single%0D%0A * statement, or of a sequence of statements.%0D%0A * %3Cp%3E%0D%0A * All statements in one %7B@code DbOperation%7D must be part of the same database transaction.
 %0D%0A
-
  */%0D%0Apub
@@ -544,22 +544,16 @@
  open.%0D%0A
-%09 * %0D%0A
 %09 * @ret
@@ -882,14 +882,8 @@
 d.%0D%0A
-%09 * %0D%0A
 %09 * 
@@ -957,15 +957,11 @@
 on%0D%0A
+
 %09 *
-    
     

add javadoc