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); }

Want to kickstart your project?Use the new AI Studio to create your code