LexarG56

Generation

generate functionWed, 19 Jul 2023

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

public class delete extends ActionPerformed{ button.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ String sql = "DELETE FROM tbl_producto WHERE codigo = ?"; PreparedStatement ps = conn.prepareStatement(sql); String producto.text = codigo; ps.setString(1, producto.text); ps.execute(); } } }

Questions about programming?Chat with your personal AI assistant