@Moraisdelimahigor escreveu:
É o seguinte: Quando vou faze o update com o JTable, não retorna nenhum erro, porém, nada muda no banco de dados (já tentei atualiza-lo).
Código-fonte:
private void salvarActionPerformed(java.awt.event.ActionEvent evt) { for (int i = 0; i < tabela.getRowCount(); i++) { try { PreparedStatement pst = c.conn.prepareStatement("update ESTADOS" + " set NOME_DO_ESTADO = ?" + " where SIGLA_DO_ESTADO = ?"); pst.setString(1, (String) tabela.getValueAt(i, 1)); pst.setString(2, (String) tabela.getValueAt(i, 2)); pst.executeUpdate(); JOptionPane.showMessageDialog(null, "DEU CERTO!"); } catch (SQLException ex) { Logger.getLogger(Inserção.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(null, "Num vai dá não!\nERRO:" + " " + ex); } break; } }
Mensagens: 1
Participantes: 1