private void saveNewInfo() { emailAddress = EmailAddressTextBox.getText().replaceAll("'", "''"); emailUsername = UserNameTextBox.getText().replaceAll("'", "''"); emailPassword = PasswordTextBox.getText().replaceAll("'", "''"); emailHostServer = IMAPServerTextBox.getText().replaceAll("'", "''"); emailHostPort = IMAPPortTextBox.getText().replaceAll("'", "''"); emailOutServer = SMTPServerTextBox.getText().replaceAll("'", "''"); emailOutPort = SMTPPortTextBox.getText().replaceAll("'", "''"); authenticationCheckboxSelection = AuthenticationCheckBox().toString(); }
public void newUserEmailInformation() { try { if (UserNameTextBox.isEnabled()) { int userID = global.UserNameRS.getInt("UserID"); global.UserName = global.con.createStatement(); global.UserName.executeUpdate( "UPDATE users SET " + "Email = '" + EmailAddressTextBox.getText().replaceAll("'", "''") + "'," + "EmailUsername = '******'", "''") + "'," + "EmailPassword = '******'", "''") + "'," + "EmailServer = '" + IMAPServerTextBox.getText().replaceAll("'", "''") + "'," + "EmailPort = '" + IMAPPortTextBox.getText().replaceAll("'", "''") + "'," + "EmailServerOut = '" + SMTPServerTextBox.getText().replaceAll("'", "''") + "'," + "EmailPortOut = '" + SMTPPortTextBox.getText().replaceAll("'", "''") + "'," + "Authentication = '" + AuthenticationCheckBox() + "' " + "where UserID = " + userID); } else { int userID = global.UserNameRS.getInt("UserID"); global.UserName = global.con.createStatement(); global.UserName.executeUpdate( "UPDATE users SET " + "Email = '" + EmailAddressTextBox.getText().replaceAll("'", "''") + "'," + "EmailUsername = '******'", "''") + "'," + "EmailPassword = '******'", "''") + "'," + "EmailServer = '" + IMAPServerTextBox.getText().replaceAll("'", "''") + "'," + "EmailPort = '" + IMAPPortTextBox.getText().replaceAll("'", "''") + "'," + "EmailServerOut = '" + SMTPServerTextBox.getText().replaceAll("'", "''") + "'," + "EmailPortOut = '" + SMTPPortTextBox.getText().replaceAll("'", "''") + "'," + "Authentication = '" + AuthenticationCheckBox() + "' " + "where UserID = " + userID); } } 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(), "Err0503", error.toString()); } }