1
I created a Web Service REST in Java. All operations are working except that of DELETE which returns the following error:
HTTP DELETE method:
@DELETE
@Path("excluir/{idpromocao}")
public void excluir(@PathParam("idpromocao") int idpromocao){
Promocao P = new Promocao();
P.setIdpromocao(idpromocao);
PromocaoOp promo = new PromocaoOp();
P = promo.buscar(P);
promo.remove(P);
}
Exclusion method:
public void remove(Promocao promocao) {
id_conexao = N.Conectar();
String sql = "delete from promocao where idpromocao=?";
try {
stmt = id_conexao.prepareStatement(sql);
stmt.setInt(1, promocao.getIdpromocao());
//executa
stmt.execute();
System.out.println("Excluido");
} catch (SQLException e) {
System.err.println("ERRO ao excluir promoção - " + e);
} finally {
N.Desconectar();
}
}
I believe it should be duplicated: https://answall.com/q/214147/132
– Victor Stafusa
Other similar case: https://answall.com/q/220738/132
– Victor Stafusa