// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/EnvSettings.java
// public class EnvSettings {
//     private final String prefix;
// 
//     private EnvSettings(String prefix) {
//         this.prefix = prefix;
//     }
// 
//     public String getDbPatchFile() {
//         return prefix + "dbpatch.file";
//     }
// 
//     public String getDbPatchConfiguration() {
//         return prefix + "dbpatch.configuration";
//     }
// 
//     public String getDbPatchStop() {
//         return prefix + "dbpatch.stop";
//     }
// 
//     public String getDbPatchSingle() {
//         return prefix + "dbpatch.single";
//     }
// 
//     public String getLogLevel() {
//         return prefix + "dbpatch.logLevel";
//     }
// 
//     public static EnvSettings standalone() {
//         return new EnvSettings("");
//     }
// 
//     public static EnvSettings maven() {
//         return new EnvSettings("maven.");
//     }
// 
//     public static EnvSettings gradle() {
//         return new EnvSettings("gradle.");
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/impl/CloseUtil.java
// public class CloseUtil {
// 
//     private CloseUtil() {
//     }
// 
//     public static void close(Closeable closeable) {
//         try {
//             if (closeable != null) {
//                 closeable.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(Statement statement) {
//         try {
//             if (statement != null) {
//                 statement.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(Connection conn) {
//         try {
//             if (conn != null) {
//                 conn.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(ResultSet rs) {
//         try {
//             if (rs != null) {
//                 rs.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
// }


import org.jsoftware.dbpatch.config.EnvSettings;
import org.jsoftware.dbpatch.impl.CloseUtil;
import java.sql.*;
package org.jsoftware.dbpatch.command;



/**
 * Command: Mark patches &quot;in progress&quot; as committed.
 *
 * @author szalik
 */
public class SkipErrorsCommand extends AbstractSingleConfDbPatchCommand {

    public SkipErrorsCommand(EnvSettings envSettings) {
        super(envSettings);
    }


    protected void executeInternal() throws Exception {
        Connection connection = manager.getConnection();
        Statement statement = null;
        ResultSet rs = null;
        PreparedStatement ps = null;
        try {
            statement = connection.createStatement();
            rs = statement.executeQuery("SELECT patch_name FROM " + manager.getTableName() + " WHERE patch_db_date IS NULL");
            ps = connection.prepareStatement("UPDATE " + manager.getTableName() + " SET patch_db_date=? WHERE patch_name=?");
            ps.setDate(1, new Date(0));
            while (rs.next()) {
                ps.setString(2, rs.getString(1));
                ps.execute();
                log.info("Mark to skip " + rs.getString(1));
            }
            connection.commit();
        } finally {
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/EnvSettings.java
// public class EnvSettings {
//     private final String prefix;
// 
//     private EnvSettings(String prefix) {
//         this.prefix = prefix;
//     }
// 
//     public String getDbPatchFile() {
//         return prefix + "dbpatch.file";
//     }
// 
//     public String getDbPatchConfiguration() {
//         return prefix + "dbpatch.configuration";
//     }
// 
//     public String getDbPatchStop() {
//         return prefix + "dbpatch.stop";
//     }
// 
//     public String getDbPatchSingle() {
//         return prefix + "dbpatch.single";
//     }
// 
//     public String getLogLevel() {
//         return prefix + "dbpatch.logLevel";
//     }
// 
//     public static EnvSettings standalone() {
//         return new EnvSettings("");
//     }
// 
//     public static EnvSettings maven() {
//         return new EnvSettings("maven.");
//     }
// 
//     public static EnvSettings gradle() {
//         return new EnvSettings("gradle.");
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/impl/CloseUtil.java
// public class CloseUtil {
// 
//     private CloseUtil() {
//     }
// 
//     public static void close(Closeable closeable) {
//         try {
//             if (closeable != null) {
//                 closeable.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(Statement statement) {
//         try {
//             if (statement != null) {
//                 statement.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(Connection conn) {
//         try {
//             if (conn != null) {
//                 conn.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
//     public static void close(ResultSet rs) {
//         try {
//             if (rs != null) {
//                 rs.close();
//             }
//         } catch (Exception e) {	/* findBugs ok */ }
//     }
// 
// }


// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/command/SkipErrorsCommand.java
import org.jsoftware.dbpatch.config.EnvSettings;
import org.jsoftware.dbpatch.impl.CloseUtil;
import java.sql.*;

package org.jsoftware.dbpatch.command;



/**
 * Command: Mark patches &quot;in progress&quot; as committed.
 *
 * @author szalik
 */
public class SkipErrorsCommand extends AbstractSingleConfDbPatchCommand {

    public SkipErrorsCommand(EnvSettings envSettings) {
        super(envSettings);
    }


    protected void executeInternal() throws Exception {
        Connection connection = manager.getConnection();
        Statement statement = null;
        ResultSet rs = null;
        PreparedStatement ps = null;
        try {
            statement = connection.createStatement();
            rs = statement.executeQuery("SELECT patch_name FROM " + manager.getTableName() + " WHERE patch_db_date IS NULL");
            ps = connection.prepareStatement("UPDATE " + manager.getTableName() + " SET patch_db_date=? WHERE patch_name=?");
            ps.setDate(1, new Date(0));
            while (rs.next()) {
                ps.setString(2, rs.getString(1));
                ps.execute();
                log.info("Mark to skip " + rs.getString(1));
            }
            connection.commit();
        } finally {
            CloseUtil.close(statement);