title: Sql Command To Delete Values Taken From Text Fields
body: <p>I use this command to insert a new client, I have a method in Java where I assign the values to the command:</p>
  
  <pre><code>insertNewPerson = connection.prepareStatement(
                      "INSERT INTO Addresses " + 
                      "(FirstName, LastName, Email, PhoneNumber, ClientAddress ) " +
                      "VALUES (?, ?, ?, ?, ?)" );
  </code></pre>
  
  <p>Question: I am looking for something similar but for DELETING whatever entries are in the text fields of the program.</p>
  
  <p>Here is the Java method I use to set the values in the sql command:</p>
  
  <pre><code>public int addPerson(
              String fname, String lname, String email, String num, String caddress)
      {
          int result = 0;
  
          //set parameters, then execute insertNewPerson
          try {
              insertNewPerson.setString(1, fname);
              insertNewPerson.setString(2, lname);
              insertNewPerson.setString(3, email);
              insertNewPerson.setString(4, num);
              insertNewPerson.setString(5, caddress);
  
              //insert the new entry; return # of rows updated
              result = insertNewPerson.executeUpdate();
          }//end try
          catch(SQLException sqlException) {
              sqlException.printStackTrace();
              close();
          }//end catch
  
          return result;
      }//end method addPerson
  </code></pre>