@Override
    public Integer applyAction(Connection db) {
        PreparedStatement st = null;
        try {
            String sql = getSql();
            try {
                st = db.prepareStatement(sql);
            }
            catch (SQLException e) {
                throw new CoreException("Unable to prepare update action for query " + sql, e);
            }
            List<Object> binds = getBindings();
            if (binds != null && binds.isEmpty() == false) {
                for (int i = 0; i < binds.size(); i++) {
                    Object o = binds.get(i);
                    try {
                        st.setObject((i + 1), o);
                    }
                    catch (SQLException e) {
                        throw new CoreException("Unable to bind param " + (i + 1) + " for sql " + sql + " with param " + o, e);
                    }
                }
            }
            try {
                logger.log(Level.DEBUG, "Executing %s with bound params %s", sql, binds);
                int res = st.executeUpdate();
                logger.log(Level.DEBUG, "Executing %s affected %s rows", sql, res);
                return res;
            }
            catch (SQLException e) {
                throw new CoreException("Unable to execute update for sql " + sql + " with params " + StringUtils.join(binds, ","), e);
            }
        }
        finally {
            if (st != null) {
                try {
                    st.close();
                }
                catch (SQLException e) {
                    logger.log(Level.WARN, "Error closing update action prepared statement", e);
                }
            }
        }
    }