public List<Message> DisplayAllMessagesRecieved (String R){


        List<Message> listemsg = new ArrayList<>();

        String requete = "select * from message where Reciever ='"+R+"'";
        try {
           
           Statement statement = MyConnection.getInstance()
                   .createStatement();
            
            ResultSet resultat = statement.executeQuery(requete);
            
            while(resultat.next()){
                Message msg =new Message();
                msg.setId_message(resultat.getInt(1));
                msg.setFrom(resultat.getString(2));
                msg.setTo(resultat.getString(3));
                msg.setObject(resultat.getString(4));
                msg.setContent(resultat.getString(5));
                //msg.setDate(resultat.getDate(6).toString());
                msg.setRead(resultat.getBoolean(7));
                System.out.println("+ "+resultat.getInt(7));
                listemsg.add(msg);
            }
            return listemsg;
        } catch (SQLException ex) {
           //Logger.getLogger(PersonneDao.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("MessageDAO : erreur lors du chargement des depots "+ex.getMessage());
            return null;
        }
    }