// 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.impl.CloseUtil;
import org.jsoftware.dbpatch.impl.PatchStatement;
import java.sql.*;
        if (sql.toLowerCase().startsWith("execute ")) {
            sql = sql.substring(8);
            sql = "{ call " + sql + " }";
            PatchExecutionResultImpl result = new PatchExecutionResultImpl(ps);
            try {
                c.clearWarnings();
                CallableStatement p = c.prepareCall(sql);
                p.execute();
                p.close();
                result.setSqlWarning(c.getWarnings());
            } catch (SQLException e) {
                result.setCause(e);
            }
            return result;
        }
        return super.executeStatement(c, ps);
    }


    public Timestamp getNow(Connection con) throws SQLException {
        Statement stm = null;
        ResultSet rs = null;
        try {
            stm = con.createStatement();
            rs = stm.executeQuery("SELECT sysdate FROM dual");
            if (! rs.next()) {
                throw new SQLException("No rows returned.");
            }
            return rs.getTimestamp(1);
        } finally {
// 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/config/dialect/OracleDialect.java
import org.jsoftware.dbpatch.impl.CloseUtil;
import org.jsoftware.dbpatch.impl.PatchStatement;
import java.sql.*;

        if (sql.toLowerCase().startsWith("execute ")) {
            sql = sql.substring(8);
            sql = "{ call " + sql + " }";
            PatchExecutionResultImpl result = new PatchExecutionResultImpl(ps);
            try {
                c.clearWarnings();
                CallableStatement p = c.prepareCall(sql);
                p.execute();
                p.close();
                result.setSqlWarning(c.getWarnings());
            } catch (SQLException e) {
                result.setCause(e);
            }
            return result;
        }
        return super.executeStatement(c, ps);
    }


    public Timestamp getNow(Connection con) throws SQLException {
        Statement stm = null;
        ResultSet rs = null;
        try {
            stm = con.createStatement();
            rs = stm.executeQuery("SELECT sysdate FROM dual");
            if (! rs.next()) {
                throw new SQLException("No rows returned.");
            }
            return rs.getTimestamp(1);
        } finally {
            CloseUtil.close(rs);