title: How to send a parameterized DELETE to MySql from Java
body: <p>I want to delete from a table called <code>PersonnelTable</code> in the following way : </p>
  
  <pre><code>public void verifyDetailsBeforeClosingAccount(String _idNumber,String _username,String _password ,String _account)
  {
  
      String retrievedNumberAccount = null;
      String retrievedOwnerIdnumber = null;
  
      try
      {
  
          // take all the rows with "account-number" and "id-numbder" in the "Checking-account-table" 
  
          ResultSet results = this.m_statement.executeQuery("SELECT `AccountNumber`, `IdNumber`  FROM `CheckingAccountsTable`");  
          while (results.next() == true)
          {
              retrievedNumberAccount = results.getString("AccountNumber");  // take the account number 
              retrievedOwnerIdnumber = results.getString("IdNumber");       // take the ID number 
  
              if (retrievedNumberAccount.equals(_account) == true &amp;&amp; retrievedOwnerIdnumber.equals(_idNumber) == true )  // found a partial match 
              {
                  // put something here
              }
          }
      }
  }
  </code></pre>
  
  <p>I want to delete a line in <code>PersonnelTable</code> , where:</p>
  
  <ol>
  <li><code>Password</code> column in the table equals the <code>_password</code> given to the function , </li>
  <li><code>UserName</code> column in the table equals the _<code>username</code>given to the function .</li>
  </ol>
  
  <p>That doesn't work : </p>
  
  <pre><code>this.m_statement.executeQuery("DELETE FROM `PersonnelTable` WHERE `Password` = _password AND `UserName` =_username ");
  </code></pre>
  
  <p>I've looked at the tutorials of <code>DELETE</code> but nothing showed how to deal with given values into a function . How can I fix this ? </p>
  
  <p>Regards</p>