本文整理汇总了C++中Environment::GetDiagnosticRecords方法的典型用法代码示例。如果您正苦于以下问题:C++ Environment::GetDiagnosticRecords方法的具体用法?C++ Environment::GetDiagnosticRecords怎么用?C++ Environment::GetDiagnosticRecords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::GetDiagnosticRecords方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLGetEnvAttr
SQLRETURN SQLGetEnvAttr(SQLHENV env,
SQLINTEGER attr,
SQLPOINTER valueBuf,
SQLINTEGER valueBufLen,
SQLINTEGER* valueResLen)
{
using namespace odbc;
using namespace type_traits;
using app::ApplicationDataBuffer;
LOG_MSG("SQLGetEnvAttr called");
Environment *environment = reinterpret_cast<Environment*>(env);
if (!environment)
return SQL_INVALID_HANDLE;
SqlLen outResLen;
ApplicationDataBuffer outBuffer(OdbcNativeType::AI_DEFAULT, valueBuf,
static_cast<int32_t>(valueBufLen), &outResLen);
environment->GetAttribute(attr, outBuffer);
if (valueResLen)
*valueResLen = static_cast<SQLSMALLINT>(outResLen);
return environment->GetDiagnosticRecords().GetReturnCode();
}
示例2: SQLEndTran
SQLRETURN SQLEndTran(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT completionType)
{
using namespace odbc;
LOG_MSG("SQLEndTran called");
SQLRETURN result;
switch (handleType)
{
case SQL_HANDLE_ENV:
{
Environment *env = reinterpret_cast<Environment*>(handle);
if (!env)
return SQL_INVALID_HANDLE;
if (completionType == SQL_COMMIT)
env->TransactionCommit();
else
env->TransactionRollback();
result = env->GetDiagnosticRecords().GetReturnCode();
break;
}
case SQL_HANDLE_DBC:
{
Connection *conn = reinterpret_cast<Connection*>(handle);
if (!conn)
return SQL_INVALID_HANDLE;
if (completionType == SQL_COMMIT)
conn->TransactionCommit();
else
conn->TransactionRollback();
result = conn->GetDiagnosticRecords().GetReturnCode();
break;
}
default:
{
result = SQL_INVALID_HANDLE;
break;
}
}
return result;
}
示例3: SQLSetEnvAttr
SQLRETURN SQLSetEnvAttr(SQLHENV env,
SQLINTEGER attr,
SQLPOINTER value,
SQLINTEGER valueLen)
{
using odbc::Environment;
LOG_MSG("SQLSetEnvAttr called");
Environment *environment = reinterpret_cast<Environment*>(env);
if (!environment)
return SQL_INVALID_HANDLE;
environment->SetAttribute(attr, value, valueLen);
return environment->GetDiagnosticRecords().GetReturnCode();
}
示例4: SQLAllocConnect
SQLRETURN SQLAllocConnect(SQLHENV env, SQLHDBC* conn)
{
using odbc::Environment;
using odbc::Connection;
LOG_MSG("SQLAllocConnect called");
*conn = SQL_NULL_HDBC;
Environment *environment = reinterpret_cast<Environment*>(env);
if (!environment)
return SQL_INVALID_HANDLE;
Connection *connection = environment->CreateConnection();
if (!connection)
return environment->GetDiagnosticRecords().GetReturnCode();
*conn = reinterpret_cast<SQLHDBC>(connection);
return SQL_SUCCESS;
}