本文整理汇总了C++中IDatabase::FreeHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ IDatabase::FreeHandle方法的具体用法?C++ IDatabase::FreeHandle怎么用?C++ IDatabase::FreeHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDatabase
的用法示例。
在下文中一共展示了IDatabase::FreeHandle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunThread
void MysqlThread::RunThread(IThreadHandle *pHandle)
{
DatabaseInfo info;
info.database = m_db.chars();
info.pass = "";
info.user = "";
info.host = "";
info.port = 0;
float save_time = m_qrInfo.queue_time;
memset(&m_qrInfo, 0, sizeof(m_qrInfo));
m_qrInfo.queue_time = save_time;
IDatabase *pDatabase = g_Sqlite.Connect(&info, &m_qrInfo.amxinfo.info.errorcode, m_qrInfo.amxinfo.error, 254);
IQuery *pQuery = NULL;
if (!pDatabase)
{
m_qrInfo.connect_success = false;
m_qrInfo.query_success = false;
} else {
m_qrInfo.connect_success = true;
pQuery = pDatabase->PrepareQuery(m_query.chars());
if (!pQuery->Execute2(&m_qrInfo.amxinfo.info, m_qrInfo.amxinfo.error, 254))
{
m_qrInfo.query_success = false;
} else {
m_qrInfo.query_success = true;
}
}
if (m_qrInfo.query_success && m_qrInfo.amxinfo.info.rs)
{
m_atomicResult.CopyFrom(m_qrInfo.amxinfo.info.rs);
m_qrInfo.amxinfo.info.rs = &m_atomicResult;
}
if (pQuery)
{
m_qrInfo.amxinfo.pQuery = pQuery;
} else {
m_qrInfo.amxinfo.opt_ptr = new char[m_query.length() + 1];
strcpy(m_qrInfo.amxinfo.opt_ptr, m_query.chars());
}
if (pDatabase)
{
pDatabase->FreeHandle();
pDatabase = NULL;
}
}
示例2: FreeDatabase
void FreeDatabase(void *p, unsigned int num)
{
IDatabase *db = (IDatabase *)p;
db->FreeHandle();
}