本文整理汇总了C++中IPAddressSQLHelper::GetAddress2Equals方法的典型用法代码示例。如果您正苦于以下问题:C++ IPAddressSQLHelper::GetAddress2Equals方法的具体用法?C++ IPAddressSQLHelper::GetAddress2Equals怎么用?C++ IPAddressSQLHelper::GetAddress2Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPAddressSQLHelper
的用法示例。
在下文中一共展示了IPAddressSQLHelper::GetAddress2Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Instance
bool
PersistentLogonFailure::ClearFailuresByIP(const IPAddress &ipaddress)
{
IPAddressSQLHelper helper;
String whereClause;
whereClause.Format(_T("ipaddress1 %s and ipaddress2 %s"),
String(helper.GetAddress1Equals(ipaddress)),
String(helper.GetAddress2Equals(ipaddress)));
SQLStatement statement;
statement.SetStatementType(SQLStatement::STDelete);
statement.SetWhereClause(whereClause);
statement.SetTable("hm_logon_failures");
return Application::Instance()->GetDBManager()->Execute(statement);
}
示例2: command
shared_ptr<GreyListTriplet>
PersistentGreyList::GetRecord(const String &sSenderAddress, const String &sRecipientAddress, const IPAddress & remoteIP)
//---------------------------------------------------------------------------()
// DESCRIPTION:
// Returns a grey list triple based on sender, recipient and IP address.
//---------------------------------------------------------------------------()
{
shared_ptr<GreyListTriplet> pTriplet;
IPAddressSQLHelper helper;
String sSQL;
sSQL.Format(_T("select * from hm_greylisting_triplets where glipaddress1 %s and glipaddress2 %s and glsenderaddress = @SENDERADDRESS and glrecipientaddress = @RECIPIENTADDRESS"),
String(helper.GetAddress1Equals(remoteIP)),
String(helper.GetAddress2Equals(remoteIP)));
SQLCommand command(sSQL);
command.AddParameter("@SENDERADDRESS", sSenderAddress);
command.AddParameter("@RECIPIENTADDRESS", sRecipientAddress);
shared_ptr<DALRecordset> pRS = Application::Instance()->GetDBManager()->OpenRecordset(command);
if (!pRS || pRS->IsEOF())
{
// Not found
return pTriplet;
}
// Read the record.
pTriplet = shared_ptr<GreyListTriplet>(new GreyListTriplet);
pTriplet->SetID(pRS->GetInt64Value("glid"));
pTriplet->SetCreateTime(pRS->GetStringValue("glcreatetime"));
pTriplet->SetBlockEndTime(pRS->GetStringValue("glblockendtime"));
pTriplet->SetDeleteTime(pRS->GetStringValue("gldeletetime"));
pTriplet->SetIPAddress(IPAddress(pRS->GetInt64Value("glipaddress1"), pRS->GetInt64Value("glipaddress2")));
pTriplet->SetSenderAddress(pRS->GetStringValue("glsenderaddress"));
pTriplet->SetRecipientAddress(pRS->GetStringValue("glrecipientaddress"));
pTriplet->SetPassedCount(pRS->GetLongValue("glpassedcount"));
pTriplet->SetBlockedCount(pRS->GetLongValue("glblockedcount"));
return pTriplet;
}
示例3: command
int
PersistentLogonFailure::GetCurrrentFailureCount(const IPAddress &ipaddress)
{
IPAddressSQLHelper helper;
String sql;
sql.Format(_T("select count(*) as c from hm_logon_failures where ipaddress1 %s and ipaddress2 %s"),
String(helper.GetAddress1Equals(ipaddress)),
String(helper.GetAddress2Equals(ipaddress)));
SQLCommand command(sql);
shared_ptr<DALRecordset> pRS = Application::Instance()->GetDBManager()->OpenRecordset(command);
if (!pRS)
return 0;
long count = pRS->GetLongValue("c");
return count;
}