private void update() { try { if (jTable1.getSelectedRow() > -1) { String id = jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString(); global.ActivityType = global.con.createStatement(); global.ActivityType.executeUpdate( "UPDATE activitytypes SET Active = " + active() + " where ActivityTypeID = " + id); } addAudit( "Changed Activity Type Status: " + jTable1.getValueAt(jTable1.getSelectedRow(), 0).toString().replaceAll("'", "''") + " to " + jTable1.getValueAt(jTable1.getSelectedRow(), 2).toString().replaceAll("'", "''")); jTable1.getSelectionModel().clearSelection(); } catch (SQLException ex) { StringWriter error = new StringWriter(); ex.printStackTrace(new PrintWriter(error)); SystemCrashDialog crash = new SystemCrashDialog( global.root, true, global, global.root.getHeaderRootPanel1().getClientComboBox().getSelectedItem().toString(), global.root.getHeaderRootPanel1().getMatterComboBox().getSelectedItem().toString(), "Err0007", error.toString()); } }