public Message findUserByLogin(int id){
    Message Msg = new Message();
     String requete = "select * from Message where 'Id'=?";
        try {
            PreparedStatement ps = MyConnection.getInstance().prepareStatement(requete);
            ps.setInt(1, id);
            ResultSet resultat = ps.executeQuery();
            while (resultat.next())
            {
                
                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.setRead(resultat.getBoolean(6));
            }
            return Msg;

        } catch (SQLException ex) {
           //Logger.getLogger(PersonneDao.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("Error : "+ex.getMessage());
            return null;
        }
    }