PersonnelTable
我想从以下列方式调用的表中删除:
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 && retrievedOwnerIdnumber.equals(_idNumber) == true ) // found a partial match
{
// put something here
}
}
}
}
我想删除 中的一行PersonnelTable
,其中:
Password
表中的列等于_password
函数的给定值,UserName
表中的列等于username
给函数的 _。
那不起作用:
this.m_statement.executeQuery("DELETE FROM `PersonnelTable` WHERE `Password` = _password AND `UserName` =_username ");
我查看了教程,DELETE
但没有显示如何将给定值处理为函数。我怎样才能解决这个问题 ?
问候