Bonjour,

Je débute en Java, et j'ai un petit problème pour récupérer un paramètre d'une page php.
je regarde sur net toutes les solutions, rien ne fonctionne. Soit ca me retourne null, soit ca prend comme valeur le nom ou j'ai une erreur.

Voici mon code :

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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
 
package templates.form.mod_int_adm;
 
import javax.swing.table.AbstractTableModel;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.io.*;
import java.net.*;
import java.lang.*;
import java.security.*;
import java.sql.*;
import java.util.Locale;
 
public class ModeleModifiable2 extends AbstractTableModel {
    private final List<Ami> amis = new ArrayList<Ami>();
    private final String[] entetes = {"Num Int.", "Date Appel", "Utilisateur", "Juridiction", "Tech", "Objet"};
 
 
    public ModeleModifiable2() {
    	super();
    	String tech = getParameter("my");
    	String pilote = "com.mysql.jdbc.Driver"; 
 
    		try{
    			Class.forName(pilote).newInstance();
 
    			Connection connexion = DriverManager.getConnection("jdbc:mysql://localhost/b_stdi","stdi","akira77");
 
    			Statement instruction = connexion.createStatement();
 
    			ResultSet resultat = instruction.executeQuery("SELECT * FROM tb_intervention WHERE int_statut='Ouvert' AND int_tech LIKE'%"+ tech +"%' ORDER BY int_num DESC");
 
 
    			while(resultat.next()){
 
    				amis.add(new Ami(""+resultat.getInt("int_num")+"", ""+resultat.getString("int_date_appel")+"", ""+resultat.getString("int_user_nom")+""+resultat.getString("int_user_prenom")+"", ""+resultat.getString("int_user_site")+"", ""+resultat.getString("int_tech")+"", ""+resultat.getString("int_objet")+""));
 
        			}
 
    			}
    		catch (Exception e){
    			System.out.println("echec pilote : "+e);
    		}
    		}
    public String getParameter(String name) {
        if (getParameter(name) != null) {
            return getParameter(name);
        } else {
            return null;
        }
    }
 
	public int getRowCount() {
        return amis.size();
    }
 
    public int getColumnCount() {
        return entetes.length;
    }
 
    public String getColumnName(int columnIndex) {
        return entetes[columnIndex];
    }
 
    public Object getValueAt(int rowIndex, int columnIndex) {
        switch(columnIndex){
            case 0:
                return amis.get(rowIndex).getNint();
            case 1:
                return amis.get(rowIndex).getdapp();
            case 2:
                return amis.get(rowIndex).getUser();
            case 3:
                return amis.get(rowIndex).getJuri();
            case 4:
                return amis.get(rowIndex).getTech();
            case 5:
                return amis.get(rowIndex).getObjet();
            default:
                return null; //Ne devrait jamais arriver
        }
    }
 
    @Override
    public Class getColumnClass(int columnIndex){
        switch(columnIndex){
            case 4 :
                return String.class;
            default:
                return Object.class;
        }
    }
 
    @Override
    public boolean isCellEditable(int rowIndex, int columnIndex) {
        return true; //Toutes les cellules éditables
    }
 
    @Override
    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
        if(aValue != null){
            Ami ami = amis.get(rowIndex);
 
            switch(columnIndex){
                case 0:
                    ami.setNint((String)aValue);
                    break;
                case 1:
                    ami.setdapp((String)aValue);
                    break;
                case 2:
                    ami.setUser((String)aValue);
                    break;
                case 3:
                    ami.setJuri((String)aValue);
                    break;
                case 4:
                    ami.setTech((String)aValue);
                    break;
                case 5:
                    ami.setObjet((String)aValue);
                    break;
            }
        }
    }
 
    public void addAmi(Ami ami) {
        amis.add(ami);
 
        fireTableRowsInserted(amis.size() -1, amis.size() -1);
    }
 
    public void removeAmi(int rowIndex) {
        amis.remove(rowIndex);
 
        fireTableRowsDeleted(rowIndex, rowIndex);
    }
}
Merci d'avance pour le coup de main.