![]() |
C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
|
#include <DBTranHelper.h>


Public 成员函数 | |
| bool | GetFreeAutoCommit () const |
| void | SetFreeAutoCommit (bool value) |
| bool | GetDisableTimeOut () const |
| void | DisableTimeOut (bool value) |
| bool | TranslateStarted () const |
| std::string | GetDBSysName () const |
| void | SetDBSysName (const std::string &value) |
| bool | HaveNextPack () const |
| CDBTranHelper (const std::string &sDBSysName, unsigned char uRouteNode=0) | |
| CDBTranHelper (const std::string &sDBSysName, CMidLinkComm *MidComm) | |
| ~CDBTranHelper () | |
| bool | ExecSQL (const std::string &sSQLScript, std::shared_ptr< CDBParameter > sSQLParas=nullptr) |
| bool | ExecProc (const std::string &sProcName, const std::string &sParameter) |
| bool | ExecProc (const std::string &sProcName, std::shared_ptr< CDBParameter > sSQLParas) |
| bool | StartTran (const std::string &sDBSysName="") |
| bool | Commit () |
| bool | RollBack () |
| int | CancelExecute (bool bBreakBussiness=false) |
| void | SetMidLinkComm (CMidLinkComm *MidComm, bool bAutoFreeComm=false) |
| mdwc::RESULT_TYPE | GetResponeDataType () |
| bool | GetAutoFreeComm () |
| void | SetAutoFreeComm (bool bAutoFreeComm) |
| std::string | GetLastErrorMessage () |
| int | GetLastErrorCode () |
| bool | HaveReturnData () |
| int | GetFieldColumnCount () |
| int | GetFieldColumnIndex (const std::string &sFieldName) |
| bool | GetFieldStruct (int iFieldNo, FIELDSTRU &pFieldStruct) |
| std::string | ReceiveDataToJson () |
| bool | GetResponseResult (bool *bNext, char *cDataBuf, unsigned int &iBufLen) |
| bool | GetResponseData (bool *bNext, char *cDataBuf, unsigned int &iBufLen) |
| std::string | GetFieldValueByName (const std::string &sFieldName) |
| std::shared_ptr< std::stringstream > | GetFieldBinDataByName (const std::string &sFieldName) |
| int | GetFieldIntValueByName (const std::string &sFieldName) |
| int64_t | GetFieldInt64ValueByName (const std::string &sFieldName) |
| float | GetFieldFloatValueByName (const std::string &sFieldName) |
| double | GetFieldDoubleValueByName (const std::string &sFieldName) |
| double | GetFieldDecimalValueByName (const std::string &sFieldName) |
| std::string | GetFieldValue (int iFieldNo) |
| std::shared_ptr< std::stringstream > | GetFieldBinValue (int iFieldNo) |
| int | GetFieldIntValue (int iFieldNo) |
| uint32_t | GetFieldUIntValue (int iFieldNo) |
| int64_t | GetFieldInt64Value (int iFieldNo) |
| uint64_t | GetFieldUInt64Value (int iFieldNo) |
| float | GetFieldFloatValue (int iFieldNo) |
| double | GetFieldDoubleValue (int iFieldNo) |
| long double | GetFieldDecimalValue (int iFieldNo) |
| void | ResetDefaultMidDBFunctonNo () |
| void | SetSystemName (std::string sSystemName) |
| RESULT_TYPE | ResponseDataType () |
| int | FetchResult () |
| bool | GetMidResult (bool *bNext=nullptr) |
静态 Public 成员函数 | |
| static void | SetSystemNameChangedCallBack (PROCNAMECALLBACK pfn) |
Protected 成员函数 | |
| void | ReleaseMidLinkComm () |
| bool | CheckMidLinkComm () |
| int | AnalyzeDBOutputPara (const std::string &sData) |
| int | CreateDataSetHeadStruct () |
| int | GetResultDataItemCount () |
| 取得返回结果的数据项数量 | |
| bool | SendDataPack (int iReqNo, const std::string &sData, bool bNewRequest=true, uint8_t uRouteID=0) |
| int | GetErrorMessageFromPack () |
| int | FetchField () |
Protected 属性 | |
| uint8_t | m_uRouteNode |
| char | m_uRcvBuf [FILE_PACK_MAX_LEN+1] |
| std::string | m_sResultBuf |
| std::map< std::string, std::shared_ptr< std::stringstream > > | m_RetBinColumns |
| std::vector< FIELDSTRU > | m_RetFields |
| int | m_iLastErrorCode |
| std::string | m_sLastErrorMsg |
| bool | m_bHaveNextPack |
| std::string | m_sMidSystemName |
单数据数据库事务操作功能,线程不安全,实例化后会占用一个通信连接,使用完后释放实例回收通信连接资源,尽量不要长期拥有实例
| mdwc::CDBTranHelper::CDBTranHelper | ( | const std::string & | sDBSysName, |
| unsigned char | uRouteNode = 0 ) |
构造函数,线程安全,使用完成后必须调用析构回收通信连接
| sDBSysName | 中间件配置的数据库系统名称,如果为空,默认调用的中间件脚本所属的数据库 |
| uRouteNode | 数据转到目标节点,为0不转发 |
构造函数,线程安全,使用完成后必须调用析构回收通信连接
| mdwc::CDBTranHelper::CDBTranHelper | ( | const std::string & | sDBSysName, |
| CMidLinkComm * | MidComm ) |
构造函数,使用完成后必须调用析构回收通信连接
| sDBSysName | 中间件配置的数据库系统名称,如果为空,默认调用的中间件脚本所属的数据库 |
| MidComm | 使用已经分配的通信连接 |
构造函数,使用完成后必须调用析构回收通信连接
| mdwc::CDBTranHelper::~CDBTranHelper | ( | ) |
析构函数,释放占用的通信连接

|
protectedinherited |
接收分析调用存储过程的返回参数
| sData | 数据 |

|
virtual |
发送取消功能请求执行并清除Socket缓存区中的内容,发送的取消命令不一定有效,依赖于服务端收到命令当前执行的状态
| bBreakBussiness | true,发送取消命令到服务端 |
发送取消功能请求执行并清除Socket缓存区中的内容,发送的取消命令不一定有效,依赖于服务端收到命令当前执行的状态
重载 mdwc::CDBBase .
|
protectedinherited |
检查通信连接是否分配


| bool mdwc::CDBTranHelper::Commit | ( | ) |
提交事务
提交事务
|
protectedinherited |
创建返回的数据集头结构

| void mdwc::CDBTranHelper::DisableTimeOut | ( | bool | value | ) |
通信超时控制
| bool mdwc::CDBTranHelper::ExecProc | ( | const std::string & | sProcName, |
| const std::string & | sParameter ) |
执行存储过程,根据返回结果类型ResponeDataType取得数据,才能执行下一语句
| sProcName | 存储过程名称 |
| sParameter | 存储过程参数 |
执行存储过程,根据返回结果类型ResponeDataType取得数据,才能执行下一语句

| bool mdwc::CDBTranHelper::ExecProc | ( | const std::string & | sProcName, |
| std::shared_ptr< CDBParameter > | sSQLParas ) |
支持带返回参数的存储过程,根据返回结果类型ResponeDataType取得数据,才能执行下一语句
| sProcName | 存储过程名称 |
| sSQLParas | 存储过程参数对象 |
支持带返回参数的存储过程,根据返回结果类型ResponeDataType取得数据,才能执行下一语句

| bool mdwc::CDBTranHelper::ExecSQL | ( | const std::string & | sSQLScript, |
| std::shared_ptr< CDBParameter > | sSQLParas = nullptr ) |
执行SQL脚本语句,如果执行select语句,根据返回结果类型ResponeDataType取得数据,才能执行下一语句
| sSQLScript | SQL脚本数据 |
| sSQLParas | 带数值参数 s |
执行SQL脚本语句,如果执行select语句,根据返回结果类型ResponeDataType取得数据,才能执行下一语句

|
protectedinherited |
获取功能调用返回的结查字段列表,如果存在的话


|
inherited |
获取功能调用结果返回到类,可以多次调用取得多行结果


|
inlineinherited |
取得是否自动释放通信连接
|
inline |
连接的系统名称.
|
inline |
禁止通信等待超时,针对长时间语句设置为true,否则执行超过通信超时会由于通信中断而失败
|
protectedinherited |
从返回数据名中获取错误信息

|
inherited |
取得指定二进制数据列的值
| sFieldName | 数据列名称 |

|
inherited |
取得指定二进制数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得当前数据集列数量
|
inherited |
根据字段名取得字段对应的列号
| sFieldName | 要查找的字段名 |
|
inherited |
取得指定十进制数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定十进制数据列的值
| sFieldName | 数据列名称 |
|
inherited |
取得指定双精度浮点数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定双精度浮点数据列的值
| sFieldName | 数据列名称 |
|
inherited |
取得指定单精度浮点数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定单精度浮点数据列的值
| sFieldName | 数据列名称 |
|
inherited |
取得指定64位整数数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定64位整数数据列的值
| sFieldName | 数据列名称 |
|
inherited |
取得指定整数数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定整数数据列的值
| sFieldName | 数据列名称 |
|
inherited |
取得字段列属性
| iFieldNo | 字段列序号,从0开始 |
| pFieldStruct | 字段列属性结构 |
|
inherited |
取得指定64位无符号整数数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定无符号整数数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定字符类型数据项的值
| iFieldNo | 数据项编号,从0开始 |
|
inherited |
取得指定字符类型数据列的值
| sFieldName | 数据列名称 |

|
inline |
此类释放时,未完成的事务是否自动提交
|
inlineinherited |
取得最后执行错误代码
|
inlineinherited |
取得最后执行的错误信息
|
inherited |
获取功能调用结果返回结果,并返回是否继续接收数据.
| bNext | 是否还有数据要接收 |

|
inlineinherited |
取得响应数据结果类型.
|
inherited |
取得功能请求结果,可以多次调用,不结束当前业务功能的处理
| bNext | 指示是否还存在结果没有接收,根据此值判断是否要继续调用此函数 |
| cDataBuf | 接收数据的缓冲 |
| iBufLen | 接收数据缓冲的有效长度 |
|
inherited |
取得功能请求结果,根据返回数据判断当前业务功能是否结束
| bNext | 指示是否还存在结果没有接收,根据此值判断是否要继续接收数据 |
| cDataBuf | 接收数据的缓冲 |
| iBufLen | 接收数据缓冲的有效长度,返回已经接收到的数据长度 |

|
protectedinherited |
取得返回结果的数据项数量
取得返回结果的数据项数量
|
inline |
是否还有后续数据包没有接收
|
inlineinherited |
是否有返回数据
|
inherited |
返回数据转换为Jason格式,一个记录一行


|
protectedinherited |
释放占用的通信连接, 对象不用的时候调用释放

|
inherited |
恢复默认的中间件访问数据库的功能号

|
inlineinherited |
取得响应数据结果类型
| bool mdwc::CDBTranHelper::RollBack | ( | ) |
回滚未完成的
回滚未完成的
|
protectedinherited |
发送数据请求
| iReqNo | 业务功能号 |
| sData | 要发送的数据 |
| bNewRequest | 新的请求标志 |
| uRouteID | 转发目标数据接点编号,为0默认当前连接的服务器处理 |


|
inlineinherited |
设置是否自动释放通信连接,强制改变必须自己控制通信连接的释放逻辑
|
inline |
设置连接的系统名称.
| value | 要设置的系统名称 |
|
inline |
设置此类释放时,未完成的事务是否自动提交
|
inherited |
设置指定的通信连接
| MidComm | 通信连接实例 |
| bAutoFreeComm | 内部释放通信连接 |

|
inherited |
设置系统名称,切换数据库访问的功能号.
| sSystemName |
设置系统名称,切换数据库访问的功能号.


|
inlinestaticinherited |
设置系统名称改变事件回调函数.
| pfn | 回调函数 |
| bool mdwc::CDBTranHelper::StartTran | ( | const std::string & | sDBSysName = "" | ) |
开始数据库事务
| sDBSysName | 中间件配置的数据库系统名称,如果为null,使用类实例化时的名称,如果为空,默认调用的中间件脚本所属的数据库 |
开始数据库事务

|
inline |
是否启动事务
|
inherited |
数据库返回参数值对象
|
protectedinherited |
是否还有后续数据包没有接收
|
inherited |
访问数据库时中间件接收SQL参数的组织形式
| int mdwc::CDBTranHelper::m_iExec_DBTrans |
中间件开启事务模式执行数据库访问操作
|
inherited |
执行存储过程返回二进制数据,匹配的中间件脚本有要求
|
inherited |
执行存储过程返回数据记录的功能号,带数据集
|
inherited |
执行指定系统存储过程返回多个数据集
|
inherited |
执行存储过程返回数据记录的功能号,不带数据集
|
inherited |
批量执行没有返回结果集的SQL语句
|
inherited |
执行SQL语句返回数据记录的功能号,带数据集
|
inherited |
执行SQL语句返回数据记录的功能号,返回多个数据集
|
inherited |
执行SQL语句返回数据记录的功能号,不带数据集
|
inherited |
更新数据表BLOB、Text、Image字段数据
|
protectedinherited |
错误代码
|
inherited |
通信连接数据收发基类实例
|
protectedinherited |
接收到的数据集大数据列的临时数据,只保存最后一次接收记录的所有列数据
|
protectedinherited |
返回的数据列结构
|
protectedinherited |
错误信息
|
protectedinherited |
/要访问的中间件业务系统名称,主要用于切换调用不同系统数据库的中间件脚本功能,默认为空,由功能号确定对应的业务系统
|
protectedinherited |
返回的数据包原始值,结果数据缓冲区
|
protectedinherited |
接收数据缓存区
|
protectedinherited |
是否要转发到目标路由节点