bonjour j'ai une classe java Service.java
contient les variables suivantes:
et dans le main j'affiche ces variable à l'aide de
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package projet; /** * * @author Youness */ public class Service { //private String vlan; private String desc; private String vrf; private String address; private String JR; public Service( String desc,String vrf,String address,String JR) { //this.vlan = vlan; this.desc = desc; this.vrf = vrf; this.address = address;; this.JR = JR; } /* public String getvlan() { return vlan; } public void setvlan(String vlan) { this.vlan = vlan; } */ public String getdesc() { return desc; } public void setdesc(String desc) { this.desc = desc; } public String getvrf() { return vrf; } public void setvrf(String vrf) { this.vrf = vrf; } public String getaddress() { return address; } public void setaddress(String address) { this.address= address; } public String getjr() { return JR; } public void setjr(String jr) { this.JR= JR; } public String toString() { return desc+" "+vrf+" "+address+" "+JR; } public void lister(){ System.out.println(desc+" "+vrf+" "+address+" "+JR); } }
alors je veux que ces variables s'ajoutent à ma table ville1 pour la bdd projet
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 ArrayList<Service> list = new ArrayList<Service>(); System.out.print("\n"+list.get(i).getdesc()+" - "); ...
Merci
Partager