private Trainer getTrainerFromCurrentRow(ResultSet results)
    {
        Integer id = extractNumber(results,"idEntity");
        String valueEntity = extractString(results, "valueEntity");
        Trainer t = new Trainer(valueEntity);
        t.setId(id);
        
        ResultSet rs = this.getResultsOfQuery("SELECT * FROM "+megatable+" WHERE idEntity = "+id);
        try {
            while (rs.next())
            {
                String name = extractString(rs, "name");
                String value = extractString(rs , "value");
                
                switch (name) {
                    case "OWN":
                        String[] pokemon_ids = value.split(",");
                        for (String p_id_number : pokemon_ids)
                        {
                            String p_id = p_id_number.substring(0,p_id_number.indexOf("("));
                            System.out.println(p_id);
                            for (Pokemon p : getAllPokemon())
                                if (p.getId() == Integer.valueOf(p_id))
                                    t.pool.add(p);
                        }
                        break;
                }
                    
                
                
            }
        } catch (SQLException ex) {
            Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return t;
    }