// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public class UcanaccessSQLException extends SQLException {
// 	public enum ExceptionMessages{
// 		CONCURRENT_PROCESS_ACCESS,
// 		INVALID_CREATE_STATEMENT,
// 		INVALID_INTERVAL_VALUE,
// 		INVALID_JACKCESS_OPENER,
// 		INVALID_MONTH_NUMBER, 
// 		NOT_A_VALID_PASSWORD, 
// 		ONLY_IN_MEMORY_ALLOWED, 
// 		UNPARSABLE_DATE,
// 		COMPLEX_TYPE_UNSUPPORTED, 
// 		INVALID_PARAMETER,
// 		INVALID_TYPES_IN_COMBINATION,
// 		UNSUPPORTED_TYPE
// 	}
// 	private static final long serialVersionUID = -1432048647665807662L;
// 	private Throwable cause;
// 	public UcanaccessSQLException() {
// 	}
// 	
// 	public UcanaccessSQLException(ExceptionMessages reason) {
// 		super(Logger.getMessage(reason.name()));
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState) {
// 		super(Logger.getMessage(reason), SQLState);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState, int vendorCode) {
// 		super(Logger.getMessage(reason), SQLState, vendorCode);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState,
// 			int vendorCode, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, vendorCode, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, Throwable cause) {
// 		super(Logger.getMessage(reason), cause);
// 	}
// 	
// 	public UcanaccessSQLException(Throwable cause) {
// 		super( explaneCause(cause));
// 		this.cause=cause;
// 	}
// 	
// 	public static String explaneCause(Throwable cause){
// 		if(cause instanceof SQLException){
// 			SQLException se=(SQLException)cause;
// 			if(se.getErrorCode()==-5562){
// 				return cause.getMessage()+" "+Logger.getMessage(ExceptionMessages.INVALID_TYPES_IN_COMBINATION.name());
// 			}
// 		}
// 		return cause.getMessage();
// 	}
// 
// 	public Throwable getCause() {
// 		return this.cause;
// 	}
// }


import com.healthmarketscience.jackcess.Cursor;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import net.ucanaccess.jdbc.UcanaccessSQLException;
	
	public boolean moveToNextRow(Cursor cur, Collection<String> columnNames)
			throws IOException {
		boolean hasNext = cur.moveToNextRow();
		if (hasNext) {
			this.currentRow = cur.getCurrentRow(columnNames);
		}
		return hasNext;
	}
	
	public IFeedbackAction  persist() throws SQLException {
		try {
			Cursor cur = indexSelector.getCursor();
			cur.beforeFirst();
			Collection<String> columnNames = composite.get(0).getRowPattern()
					.keySet();
			while (composite.size() > 0 && moveToNextRow(cur, columnNames)) {
				Iterator<ICursorCommand> it = composite.iterator();
				while (it.hasNext()) {
					ICursorCommand comm = it.next();
					if (comm.currentRowMatches(cur, this.currentRow)) {
						comm.persistCurrentRow(cur);
						it. remove();
						rollbackCache.add(comm);
						break;
					}
				}
			}
			return null;
		} catch (IOException e) {
// Path: src/main/java/net/ucanaccess/jdbc/UcanaccessSQLException.java
// public class UcanaccessSQLException extends SQLException {
// 	public enum ExceptionMessages{
// 		CONCURRENT_PROCESS_ACCESS,
// 		INVALID_CREATE_STATEMENT,
// 		INVALID_INTERVAL_VALUE,
// 		INVALID_JACKCESS_OPENER,
// 		INVALID_MONTH_NUMBER, 
// 		NOT_A_VALID_PASSWORD, 
// 		ONLY_IN_MEMORY_ALLOWED, 
// 		UNPARSABLE_DATE,
// 		COMPLEX_TYPE_UNSUPPORTED, 
// 		INVALID_PARAMETER,
// 		INVALID_TYPES_IN_COMBINATION,
// 		UNSUPPORTED_TYPE
// 	}
// 	private static final long serialVersionUID = -1432048647665807662L;
// 	private Throwable cause;
// 	public UcanaccessSQLException() {
// 	}
// 	
// 	public UcanaccessSQLException(ExceptionMessages reason) {
// 		super(Logger.getMessage(reason.name()));
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState) {
// 		super(Logger.getMessage(reason), SQLState);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String SQLState, int vendorCode) {
// 		super(Logger.getMessage(reason), SQLState, vendorCode);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState,
// 			int vendorCode, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, vendorCode, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, String sqlState, Throwable cause) {
// 		super(Logger.getMessage(reason), sqlState, cause);
// 	}
// 	
// 	public UcanaccessSQLException(String reason, Throwable cause) {
// 		super(Logger.getMessage(reason), cause);
// 	}
// 	
// 	public UcanaccessSQLException(Throwable cause) {
// 		super( explaneCause(cause));
// 		this.cause=cause;
// 	}
// 	
// 	public static String explaneCause(Throwable cause){
// 		if(cause instanceof SQLException){
// 			SQLException se=(SQLException)cause;
// 			if(se.getErrorCode()==-5562){
// 				return cause.getMessage()+" "+Logger.getMessage(ExceptionMessages.INVALID_TYPES_IN_COMBINATION.name());
// 			}
// 		}
// 		return cause.getMessage();
// 	}
// 
// 	public Throwable getCause() {
// 		return this.cause;
// 	}
// }


// Path: src/main/java/net/ucanaccess/commands/CompositeCommand.java
import com.healthmarketscience.jackcess.Cursor;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import net.ucanaccess.jdbc.UcanaccessSQLException;

	
	public boolean moveToNextRow(Cursor cur, Collection<String> columnNames)
			throws IOException {
		boolean hasNext = cur.moveToNextRow();
		if (hasNext) {
			this.currentRow = cur.getCurrentRow(columnNames);
		}
		return hasNext;
	}
	
	public IFeedbackAction  persist() throws SQLException {
		try {
			Cursor cur = indexSelector.getCursor();
			cur.beforeFirst();
			Collection<String> columnNames = composite.get(0).getRowPattern()
					.keySet();
			while (composite.size() > 0 && moveToNextRow(cur, columnNames)) {
				Iterator<ICursorCommand> it = composite.iterator();
				while (it.hasNext()) {
					ICursorCommand comm = it.next();
					if (comm.currentRowMatches(cur, this.currentRow)) {
						comm.persistCurrentRow(cur);
						it. remove();
						rollbackCache.add(comm);
						break;
					}
				}
			}
			return null;
		} catch (IOException e) {
			throw new UcanaccessSQLException(e);