We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92fd458 commit 21153ffCopy full SHA for 21153ff
Unit14/src/unit14/Actividad15_Aplicacion/DAO/EmpleadoDAO.java
@@ -142,7 +142,18 @@ public void delete(Empleado empleado) {
142
System.out.println("Error al eliminar el empleado");
143
}
144
145
+ }
146
147
+ public void delete(int id) {
148
+ if (conexion != null) {
149
+ String query = "DELETE FROM empleado WHERE numemp = ?";
150
+ try (PreparedStatement ps = conexion.prepareStatement(query)) {
151
+ ps.setInt(1, id);
152
+ ps.executeUpdate();
153
+ } catch (SQLException e) {
154
+ System.out.println("Error al eliminar el empleado");
155
156
157
158
159
private Empleado extractEmpleadoFromResultSet(ResultSet rs) throws SQLException {
0 commit comments