LexarG56

Generation

generate functionWed, 19 Jul 2023

En el actionperformed haga que un boton pueda eliminar un dato registrado de una base de datos

try { String sql = "DELETE FROM tabla1 WHERE id = ?"; PreparedStatement pst = conn.prepareStatement(sql); pst.setString(1, jTextField1.getText()); pst.executeUpdate(); JOptionPane.showMessageDialog(null, "Persona eliminada!"); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); }

Questions about programming?Chat with your personal AI assistant