1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Importjava.rmi.*
class Client {
1.public static void main (string []args){
1.String url= rmi://monserver:3284/listeutilisateur »;
2.ListeUtilisateur lu = (ListeUtilisateur)Naming.lookup(url);
3.lu.ajoute (1, »MARCEL »°.
4.If (lu.existe (2) {lu.modifie ( (lu.cherche (2))+''-- '' )}
5.else.ajoute (2, « ROBERT »);}
6.lu.ajoute (3, »MIREILLE »);
7.System.out.println(lu.cherche (1));
8.System.out.println(lu.cherche (2));
9.System.out.println(lu.cherche (3));
}
catch (Introuvable e) {}
catch (Exception e) {System.err.println(« exception : « +e.getMessage()); } |
Partager