Ola, gostaria de ajuada para baixar estoque toda vez que efetuo uma venda , como ficaria uma Trigger no mysql para fazer isso?
private void salvarNoBanco(){
try {
Contato c = new ContatoDao().getLista(jCCliente.getSelectedItem().toString()).get(0);
for (int i = 0; i < this.vendas.getRowCount(); i++) {
Vendas ven = new Vendas();
ven.setContato(c);
ven.setDescricao(this.vendas.getValueAt(i, 0).toString());
ven.setQuant(Integer.valueOf(this.vendas.getValueAt(i, 1).toString()));
ven.setValor(Double.valueOf(this.vendas.getValueAt(i,2).toString()));
ven.setTotal(Double.valueOf(this.vendas.getValueAt(i,3).toString()));
VendasDao dao =new VendasDao();
dao.adiciona(ven);