@Override
    public void setActiveForTask(int id_task, Boolean active) {
        try {
            connection = getConnection();
            ptmt = connection.prepareStatement("UPDATE Task_executors SET active=? WHERE id_task=?;");
            ptmt.setBoolean(1, active);
            ptmt.setInt(2, id_task);
            ptmt.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(TaskExecutorsDAO.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                if (ptmt != null) {
                    ptmt.close();
                }
                if (connection != null) {
                    connection.close();
                }
                if (resultSet != null) {
                    resultSet.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(UserDAO.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }