本文整理汇总了C++中CConnect::sendCDInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CConnect::sendCDInfo方法的具体用法?C++ CConnect::sendCDInfo怎么用?C++ CConnect::sendCDInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConnect
的用法示例。
在下文中一共展示了CConnect::sendCDInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
extern "C" void odbc_SQLSvc_EndTransaction_ccf_ (
CEE_tag_def cmptag_
, const struct odbc_SQLSvc_EndTransaction_exc_ *exception_
, const ERROR_DESC_LIST_def *sqlWarning
)
{
SRVR_CALL_CONTEXT *srvrCallContext = (SRVR_CALL_CONTEXT *)cmptag_;
CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;
pConnection->setExceptionErrors(exception_->exception_nr, exception_->exception_detail);
switch (exception_->exception_nr)
{
case CEE_SUCCESS:
if (sqlWarning->_length > 0)
pConnection->setDiagRec(sqlWarning);
break;
case odbc_SQLSvc_EndTransaction_SQLError_exn_:
pConnection->setDiagRec(&exception_->u.SQLError);
break;
case odbc_SQLSvc_EndTransaction_ParamError_exn_:
pConnection->setDiagRec(SERVER_ERROR, IDS_PROGRAM_ERROR, exception_->exception_nr,
exception_->u.ParamError.ParamDesc, NULL,
SQL_ROW_NUMBER_UNKNOWN, SQL_COLUMN_NUMBER_UNKNOWN, 1, pConnection->getSrvrIdentity());
break;
case odbc_SQLSvc_EndTransaction_SQLInvalidHandle_exn_:
break;
case odbc_SQLSvc_EndTransaction_InvalidConnection_exn_:
pConnection->setDiagRec(SERVER_ERROR, IDS_08_S01);
break;
case odbc_SQLSvc_EndTransaction_TransactionError_exn_:
char tmpNumBuffer[16];
_itoa (exception_->exception_detail, tmpNumBuffer, 10);
pConnection->setDiagRec(SERVER_ERROR, IDS_TRANSACTION_ERROR, exception_->exception_nr,
tmpNumBuffer, NULL, SQL_ROW_NUMBER_UNKNOWN, SQL_COLUMN_NUMBER_UNKNOWN, 1, pConnection->getSrvrIdentity());
break;
default:
pConnection->sendCDInfo(exception_->exception_nr);
pConnection->setDiagRec(exception_->exception_nr, ENDTRANSACT_PROCNAME,
pConnection->getSrvrIdentity());
break;
}
} // odbc_SQLSvc_EndTransaction_ccf_()
示例2: TERMINATE_DIALOG
SQLRETURN TERMINATE_DIALOG(SRVR_CALL_CONTEXT *srvrCallContext)
{
CEE_status sts;
long timerTimeout;
odbc_SQLSvc_TerminateDialogue_exc_ exception_;
CConnect *pConnection = (CConnect *)srvrCallContext->sqlHandle;
timerTimeout = srvrCallContext->connectionTimeout > 10 ? srvrCallContext->connectionTimeout : 10;
sts = odbc_SQLSvc_TerminateDialogue_(NULL,
srvrCallContext,
srvrCallContext->dialogueId,
&exception_);
if (sts != CEE_SUCCESS)
{
if (sts == CEE_INTERNALFAIL)
{
pConnection->setDiagRec(DRIVER_ERROR, IDS_EXCEPTION_MSG,0,"SQL SERVER",
NULL,SQL_ROW_NUMBER_UNKNOWN,SQL_COLUMN_NUMBER_UNKNOWN,2,"Internal Error","TERMINATE_DIALOG");
return SQL_ERROR;
}
pConnection->setDiagRec(DRIVER_ERROR, IDS_S1_000, sts, FORMAT_ERROR((long)pConnection->m_srvrTCPIPSystem),
NULL, SQL_ROW_NUMBER_UNKNOWN, SQL_COLUMN_NUMBER_UNKNOWN, 1, "TERMINATE_DIALOG failed");
return SQL_SUCCESS_WITH_INFO;
}
// Start CCF
pConnection->setExceptionErrors(exception_.exception_nr, exception_.exception_detail);
switch (exception_.exception_nr) {
case CEE_SUCCESS:
pConnection->resetGetObjRefHdlOutput();
break;
case odbc_SQLSvc_TerminateDialogue_SQLError_exn_:
if (exception_.exception_detail == 25000)
pConnection->setDiagRec(DRIVER_ERROR, IDS_25_000);
else
pConnection->setDiagRec(&exception_.u.SQLError);
break;
case odbc_SQLSvc_TerminateDialogue_ParamError_exn_:
pConnection->setDiagRec(SERVER_ERROR, IDS_PROGRAM_ERROR, exception_.exception_nr,
exception_.u.ParamError.ParamDesc);
break;
case odbc_SQLSvc_TerminateDialogue_InvalidConnection_exn_:
pConnection->sendCDInfo(exception_.exception_nr);
pConnection->setDiagRec(SERVER_ERROR, IDS_08_S01);
break;
default:
pConnection->sendCDInfo(exception_.exception_nr);
pConnection->setDiagRec(exception_.exception_nr, TERMINATE_DIALOG_PROCNAME,
pConnection->getSrvrIdentity());
break;
}
if (exception_.exception_detail != 25000)
CloseIO (pConnection->m_srvrTCPIPSystem);
// Close CCF
//
// cleanup
//
if(exception_.exception_nr == odbc_SQLSvc_TerminateDialogue_SQLError_exn_ &&
exception_.u.SQLError.errorList._length > 0 )
delete[] exception_.u.SQLError.errorList._buffer;
switch (pConnection->getExceptionNr())
{
case CEE_SUCCESS:
return SQL_SUCCESS;
default:
// if transaction is open return SQL_ERROR
if (pConnection->getExceptionDetail() == 25000)
return -25000;
else
// Any other errors treat them as if it has been disconnected
return SQL_SUCCESS_WITH_INFO;
}
} // TERMINATE_DIALOG()