est ce que quelqu'un a une idée sur la faute que j'ai commis en voulant faire une update a mon tableau sachant que je croit que l'erreur est dans la date avec une probabilité de 80%

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<%@page import="java.sql.*"%>
<%@page import="java.lang.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ModifierUtilisateur</title>
 <link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
//fonction pour changer la forme de la date
 
<%!
public static java.sql.Date testParseDate (String dateString)
{
    java.sql.Date sDate = null;
 
    try 
    {
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        // Conversion de la valeur String en java.util.Date via SimpleDateFormat
        java.util.Date uDate = sdf.parse(dateString);
        // puis conversion de java.util.Date en java.sql.Date (ce qui est requis pour JDBC)
        sDate = new java.sql.Date(uDate.getTime());
    } 
    catch(Exception e) 
    {
        System.err.println("Exception :");
        e.printStackTrace();
    }
    return sDate;
} 
%>
 
 
<%
String eche="";
String nom="";
String codeiso="";
String nomdecimal="";
String decimal="";
String IADEmpl="";
Connection connection=null;
Statement statement;
ResultSet rs ;
 
 
String tab[]=new String[5];
tab=request.getQueryString().split("/");
 
//pour afficher le contenu des variable est c'est encore fonctionnel
IADEmpl= tab[0];
System.out.println("IADEmpl1="+IADEmpl);
if(tab.length>1){
        System.out.println("ssssssss="+IADEmpl);
    request.getSession().setAttribute("Ncompte",IADEmpl);
        
        try{
                Class.forName("com.mysql.jdbc.Driver");
        }catch(Exception e){
                e.printStackTrace();
        }
        try{
                connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/banque","root","");
        }catch(Exception e){
                e.printStackTrace();
        }
        
        String sql="SELECT * FROM utilisateur where Ncompte='"+IADEmpl+"'" ;
        try {
                statement=connection.createStatement();
                rs = statement.executeQuery(sql);
                 if(rs.next()){
                //maDate = testParseDate(request.getParameter("echeance"));
                eche=rs.getString("echeance");
                nom=rs.getString("Ncompte");
                codeiso=rs.getString("nompre");
                nomdecimal=rs.getString("banque");
                decimal=rs.getString("moypay");
                
                 }
                
         } 
        catch (SQLException e) 
         {
                e.printStackTrace();
         }         
        finally
        {
                try
                {
                        connection.close();     
                }
                catch (Exception e)
                {
                        e.printStackTrace();
                }
        }
}
//a partir de  cette partie je ne sais plus où est mon erreur
 
else{
        IADEmpl = (String)request.getSession().getAttribute("Ncompte");
        System.out.println("IADEmpl="+IADEmpl);
        
        eche = request.getParameter("echeance");
        java.sql.Date maDate = testParseDate(request.getParameter("eche"));
        
        nom = request.getParameter("nom");
        System.out.println("nom="+nom);
        
        codeiso = request.getParameter("codeiso");
        nomdecimal = request.getParameter("nomdecimal");
        
        decimal = request.getParameter("decimal");
        try{
                Class.forName("com.mysql.jdbc.Driver");
        }catch(Exception e){
                e.printStackTrace();
        }
        try{
                connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/banque","root","");
        }catch(Exception e){
                e.printStackTrace();
        }
        
        PreparedStatement pstmt = connection.prepareStatement("update utilisateur (echeance,Ncompte,nompre,banque,moypay)VALUES (?,?,?,?,?)WHERE Ncompte= '"+IADEmpl+"'");
    pstmt.setDate(1,maDate);
    pstmt.setString(2,nom);
    pstmt.setString(3,codeiso);
    pstmt.setString(4,nomdecimal);
    pstmt.setString(5,decimal);
        try {
                statement=connection.createStatement();
                pstmt.executeUpdate();
                response.sendRedirect("client.jsp");
                
        } catch (SQLException e) {
                e.printStackTrace();
        }         
        finally{
                try{
                        connection.close();     
                }catch (Exception e){
                        e.printStackTrace();
                }
                }
}
%>
 
 
<div class="BG">
	<h4>Modifier Client</h4>	
</div>
 
<form>
<table width ="100%">
<tr>
	<td><b>echeance</b></td>
	<td><input type="text" name="echenace" style="width: 156px" value="<%=eche%>"/></td>
   </tr>
   <tr>
	<td><b>N° de compte</b></td>
	<td><input type="text" name="nom" style="width: 156px" value="<%=nom%>"/></td>
   </tr>
   <tr>
	<td><b>Nom et Prénom</b></td>
 	<td><input type="text" name="codeiso" style="width: 156px" value="<%=codeiso %>"/></td>
   </tr>
   <tr>
    <td><b>Banque</b></td>
 	<td><input type="text" name="nomdecimal" style="width: 156px" value="<%=nomdecimal %>"/></td>
   </tr>
   <tr>
    <td><b>Moyen de payement</b></td>
 	<td><input type="text" name="decimal" style="width: 156px" value="<%=decimal %>"/></td>
   </tr>
   <tr class="BG" width ="150%">
	<td colspan="4" width ="100%">
	  <input type="button" value="Valider" onClick="submit()"/>
      <input type="reset" value="Abandonner" style="width: 107px"/>
 
	</td>
   </tr>
</table>
</form>
</body>
</html>
sachant que echeance est de type Date dans ma base MySql, et les autres de type String