public static void Add(int workflowID, Parameter param, Result lift, Result drag) throws Exception
    {
        if(userID == -1)
        {
            throw new Exception("ADD_ERROR_UNKNOWN_USER");
        }
        else
        {
            //try (Connection con = DriverManager.getConnection(url + dbname, dblogin, dbpassword)) {
                            
            String checker = "SELECT * FROM workflow where id_user = ? AND id_simulation = ?";
            PreparedStatement checkstm = con.prepareStatement(checker);
            
            checkstm.setInt(1, userID);
            checkstm.setInt(2, workflowID);
            
             ResultSet checkres = checkstm.executeQuery();
             
             boolean exist = checkres.next();
             
             if(exist)
             {
                 String query = "INSERT INTO result (id_workflow, Cx, Cz, Sx, Sz, lift, drag, liftdrag, status, time, min_cx, max_cx, min_cz, max_cz, min_sx, max_sx, min_sz, max_sz) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, now(), ?, ?, ?, ?, ?, ?, ?, ?)";
                 PreparedStatement stm = con.prepareStatement(query);
                 
                 stm.setInt(1, workflowID);
                 
                 stm.setDouble(2, param.Cx);
                 stm.setDouble(3, param.Cz);
                 stm.setDouble(4, param.Sx);
                 stm.setDouble(5, param.Sz);
                 
                 stm.setDouble(6, lift.value);
                 stm.setDouble(7, drag.value);
                 
                 stm.setDouble(8, lift.value/drag.value);
                 
                 Flag f = Flag.GREEN;
                 
                 if(lift.f == Flag.AMBER || drag.f == Flag.AMBER)
                 {
                     f = Flag.AMBER;
                 }
                 
                 if(lift.f == Flag.RED || drag.f == Flag.RED)
                 {
                     f = Flag.RED;
                 }
                 
                 stm.setString(9, f.name());
                 
                 stm.setDouble(10, param.min_Cx);
                 stm.setDouble(11, param.max_Cx);
                 
                 stm.setDouble(12, param.min_Cz);
                 stm.setDouble(13, param.max_Cz);
                 
                 stm.setDouble(14, param.min_Sx);
                 stm.setDouble(15, param.max_Sx);
                 
                 stm.setDouble(16, param.min_Sz);
                 stm.setDouble(17, param.max_Sz);
                 
                 stm.executeUpdate();
             }
             else
             {
                 throw new Exception("ADD_ERROR_USER_WF_MISMATCH");
             }
             
        }
    }