jeeb2009
Messages postés75Date d'inscriptionlundi 19 janvier 2009StatutMembreDernière intervention31 mars 2009
-
20 janv. 2009 à 15:26
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013
-
20 janv. 2009 à 16:07
bonjour a tous je debute en java et souhaite supprimer un enregistrement de ma table voici l erreur generee:
Result Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.
et voici mon code:
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
try {Class.forName("com.mysql.jdbc.Driver");
url="jdbc:mysql://localhost/mabase";
con = DriverManager.getConnection(url, "root", "stockaj");
pr con.prepareStatement("SELECT nom AS n, email AS e, prenom AS p, pass AS p1 FROM mabase.identif WHERE (matricule'"+jTextField6.getText()+"')ORDER BY n DESC");
rec=pr.executeQuery();
rec.deleteRow();
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013130 20 janv. 2009 à 16:07
Salut,
Exécute directement une requête DELETE, ca ira bien plus vite :
con.execute("DELETE FROM mabase.identif WHERE (matricule
='"+jTextField6.getText()+"')");
Et si tu ne veux supprimer que le premier :
con.execute("DELETE FROM mabase.identif WHERE (matricule= '"+jTextField6.getText()+"') limit 1");
______________________________________
DarK Sidious