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

Public 成员函数 | |
| CDBParameter () | |
| bool | Add (const std::string &name, const MidDB_SQLPARA ¶) |
| bool | AddInt (const std::string &name, int value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddInt64 (const std::string &name, int64_t value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddUString (const std::string &name, const std::wstring &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddCString (const std::string &name, const std::string &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddDecimal (const std::string &name, double value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddDateTime (const std::string &name, const std::tm &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddDateTimeString (const std::string &name, const std::string &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddDate (const std::string &name, const std::tm &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddTime (const std::string &name, const std::tm &value, CDBParameterDirection direction=CDBParameterDirection::Input) |
| bool | AddBinData (const std::string &name, const uint8_t *value, int size) |
| bool | AddTextData (const std::string &name, const std::string &value) |
| bool | AddUTextData (const std::string &name, const std::wstring &value) |
| bool | AddCursor (const std::string &name) |
| bool | AddProcReturnValue (const std::string &name, CDBParameterType DataType=CDBParameterType::MPDT_INT4) |
| bool | RemoveParameter (const std::string &name) |
| bool | SetParameterValue (const std::string &name, SQLPARAVAL value) |
| MidDB_SQLPARA | GetParameter (const std::string &name) |
| MidDB_SQLPARA & | operator[] (const std::string &name) |
| MidDB_SQLPARA & | operator[] (int index) |
| std::string | GetParaName (int index) |
| std::string | GetParameterStringValue (const std::string &name) |
| int | GetParameterIntValue (const std::string &name) |
| int64_t | GetParameterInt64Value (const std::string &name) |
| double | GetParameterDecimalValue (const std::string &name) |
| std::tm | GetParameterDateTimeValue (const std::string &name) |
| std::shared_ptr< std::vector< uint8_t > > | GetParameterBinValue (const std::string &name) |
| std::string | GetParameterTextValue (const std::string &name) |
| void | Clear () |
| int | Count () |
| std::string | CreatePackForMidServer (bool bOnlyData=false) |
Public 属性 | |
| bool | InPackMerage |
Protected 属性 | |
| std::map< std::string, MidDB_SQLPARA > | m_Parameters |
| std::vector< std::string > | m_ParaNameOrders |
| bool | HaveReturnParaData |
调用存储过程命名参数处理,主要用于按参数名传递参数的场合,不需要核对参数顺序,但参数名称必须正确匹配
| mdwc::CDBParameter::CDBParameter | ( | ) |
构造函数

| bool mdwc::CDBParameter::Add | ( | const std::string & | name, |
| const MidDB_SQLPARA & | para ) |
添加参数
| name | 不能重复 |
| para | 参数结构 |

| bool mdwc::CDBParameter::AddBinData | ( | const std::string & | name, |
| const uint8_t * | value, | ||
| int | size ) |
添加二进制数据(最大只能输入48Kb数据,只能作为输入参数使用).
| name | 参数名称 |
| value | 二进制数据指针 |
| size | 数据尺寸 |


| bool mdwc::CDBParameter::AddCString | ( | const std::string & | name, |
| const std::string & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加数据库CHAR, VARCHAR字符串参数.
| name | 参数名称 |
| value | 字符参数值 |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddCursor | ( | const std::string & | name | ) |
添加数据集(游标)返回参数.
| name | 参数名称 |


| bool mdwc::CDBParameter::AddDate | ( | const std::string & | name, |
| const std::tm & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加日期类型.
| name | 参数名称 |
| value | 字符串日期,YYYY-MM-DD |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddDateTime | ( | const std::string & | name, |
| const std::tm & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加日期时间类型.
| name | 参数名称 |
| value | tm日期时间结构,不带毫秒 |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddDateTimeString | ( | const std::string & | name, |
| const std::string & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加日期时间字符串,必须保证数据库能转换识别.
| name | 参数名称 |
| value | 字符串日期时间,YYYY-MM-DD HH:MM:SS |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddDecimal | ( | const std::string & | name, |
| double | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加十进制小数参数.
| name | 参数名称 |
| value | 浮点数参数值 |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddInt | ( | const std::string & | name, |
| int | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加32位整数值


| bool mdwc::CDBParameter::AddInt64 | ( | const std::string & | name, |
| int64_t | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加64位整数值.
| name | 参数名称 |
| value | 参数整数值 |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddProcReturnValue | ( | const std::string & | name, |
| CDBParameterType | DataType = CDBParameterType::MPDT_INT4 ) |
获取存储过程、函数返回值参数,只能添加一个此类参数.
| name | 参数名称 |
| DataType | 数据类型 |


| bool mdwc::CDBParameter::AddTextData | ( | const std::string & | name, |
| const std::string & | value ) |
添加Text文本数据, 非Unicode字符集编码(只能输入).
| name | 参数名称 |
| value | 文本数据 |


| bool mdwc::CDBParameter::AddTime | ( | const std::string & | name, |
| const std::tm & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加时间类型.
| name | 参数名称 |
| value | 字符串时间,HH:MM:SS |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddUString | ( | const std::string & | name, |
| const std::wstring & | value, | ||
| CDBParameterDirection | direction = CDBParameterDirection::Input ) |
添加数据库NCHAR, NVARCHAR字符串参数.
| name | 参数名称 |
| value | Unicode字符参数值 |
| direction | 参数输入输出类型 |


| bool mdwc::CDBParameter::AddUTextData | ( | const std::string & | name, |
| const std::wstring & | value ) |
添加Unicode字符集编码文本数据(只能输入).
| name | 参数名称 |
| value | Unicode文本数据 |


| void mdwc::CDBParameter::Clear | ( | ) |
清除所有参数.

| int mdwc::CDBParameter::Count | ( | ) |
参数个数.
| std::string mdwc::CDBParameter::CreatePackForMidServer | ( | bool | bOnlyData = false | ) |
合并发送到服务器的参数.
| bOnlyData | 是否只返回数据部分 |

| mdwc::MidDB_SQLPARA mdwc::CDBParameter::GetParameter | ( | const std::string & | name | ) |
取得指定参数.
| name | 参数名称 |

| std::shared_ptr< std::vector< uint8_t > > mdwc::CDBParameter::GetParameterBinValue | ( | const std::string & | name | ) |
取得指定参数转换二进制数据.
| name | 参数名称 |

| std::tm mdwc::CDBParameter::GetParameterDateTimeValue | ( | const std::string & | name | ) |
取得指定参数转换为日期时间.
| name | 参数名称 |


| double mdwc::CDBParameter::GetParameterDecimalValue | ( | const std::string & | name | ) |
取得指定参数转换十进制小数.
| name | 参数名称 |

| int64_t mdwc::CDBParameter::GetParameterInt64Value | ( | const std::string & | name | ) |
取得指定参数转换为64位整数.
| name | 参数名称 |

| int mdwc::CDBParameter::GetParameterIntValue | ( | const std::string & | name | ) |
取得指定参数转换为32位整数.
| name | 参数名称 |

| std::string mdwc::CDBParameter::GetParameterStringValue | ( | const std::string & | name | ) |
取得指定参数转换为字符串.
| name | 参数名称 |

| std::string mdwc::CDBParameter::GetParameterTextValue | ( | const std::string & | name | ) |
取得大文本数据.
| name | 参数名称 |

| std::string mdwc::CDBParameter::GetParaName | ( | int | index | ) |
取得指定序号位置的参数名.
| index | 参数序号 |

| mdwc::MidDB_SQLPARA & mdwc::CDBParameter::operator[] | ( | const std::string & | name | ) |
直接按名称修改参数值.
| name | 参数名称 |

| mdwc::MidDB_SQLPARA & mdwc::CDBParameter::operator[] | ( | int | index | ) |
直接按序号修改参数值.
| index | 参数序号 |
| bool mdwc::CDBParameter::RemoveParameter | ( | const std::string & | name | ) |
移除指定的参数.
| name | 参数名称 |

| bool mdwc::CDBParameter::SetParameterValue | ( | const std::string & | name, |
| SQLPARAVAL | value ) |
修改指定参数值.
| name | 参数名称 |
| value | 参数容器值 |

|
protected |
是否有返回参数数据
| bool mdwc::CDBParameter::InPackMerage |
合并为一个中间件协议参数,与中间件业务脚本中的接收参数对应
|
protected |
内部参数存储
|
protected |
保存参数顺序