probleme d'insertion dans une table
Bonjour tout le monde,
en fait j'ai un problem d'insertion dans une table, je lui passe les champs dans l'Insert mais ca me sort toujours la meme exception:
java.sql.SQLException: [Microsoft][Pilote ODBC Microsoft Access] Trop peu de paramètres. 2 attendu.
pourtant j'ai deja fait une telle insertion dans une autre table sans soucis et en voila le code qui genere cette exception :
Code:
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
| int numc=Integer.parseInt(jtxtnumc.getText());
int telc=Integer.parseInt(jtxttelc.getText());
String nomc=jtxtnomc.getText();
String prenomc=jtxtprenomc.getText();
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:rle";
con = DriverManager.getConnection(url, "", "");
Statement requete1 = con.createStatement();
System.out.println("Numc"+numc+"pren"+prenomc+"Nom"+nomc+"Tel"+telc);
ResultSet rt = requete1.executeQuery(
"insert into tclient values("+numc+","+nomc+","+prenomc+","+telc+")");
System.out.println("zaama");
} catch (Exception e66) {System.out.println(e66);
} finally {
try {
con.close();
} catch (SQLException e66) {
System.out.println("sqlexc");
e66.printStackTrace();
} |
v