Probleme JDBC - JSP

Fermé
iraho Messages postés 38 Date d'inscription mardi 24 avril 2007 Statut Membre Dernière intervention 20 août 2009 - 16 mai 2007 à 18:02
KmiK Messages postés 24 Date d'inscription mardi 15 mai 2007 Statut Membre Dernière intervention 21 mai 2007 - 16 mai 2007 à 18:11
Bonjour. j'ai un problème que j'arrive pas a régler et je suis perdue.
En fait, jai un code (jsp) :
String req = "update Fournisseur set Tel_bureau='"
+ tl + "', Tel_portable='"+ tp + "', Telecopie='"
+ tc + "', Contact='" + pe + "', Fonction='" + fc + "', Mail='"
+ ml + "', Site='" + nt + "', Adresse='" + ad + "', Code_post='"
+ cd+ "', Ville='" + vl + "', Pays='" + pa + "' where Nom ='"
+ sc + " ' ";

ce qui me semble bien écrit, pourtant ca plante. Par contre, juste pr vérifier,quand je mets directement: where Nom = "toto" , ca marche très bien.
Et pour tester j'essaie tt: where Nom =" + sc + "", ou
where Nom =" + sc; , et ca marche pas non plus.
Alors je sais plus quoi mettre. je comprends pas pourquoi ca marche pas.
Quelqu'un peut-il bien m'aider SVP.
Merci.

1 réponse

KmiK Messages postés 24 Date d'inscription mardi 15 mai 2007 Statut Membre Dernière intervention 21 mai 2007 31
16 mai 2007 à 18:11
Bonsoir,
+ sc + "'"; 

(enlever l'espace)

sinon que contient sc (caractères spéciaux...)

cordialement
0