C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
载入中...
搜索中...
未找到
mdwc::CDBParameter类 参考

#include <CDBParameter.h>

类 mdwc::CDBParameter 继承关系图:

Public 成员函数

 CDBParameter ()
bool Add (const std::string &name, const MidDB_SQLPARA &para)
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

详细描述

调用存储过程命名参数处理,主要用于按参数名传递参数的场合,不需要核对参数顺序,但参数名称必须正确匹配

构造及析构函数说明

◆ CDBParameter()

mdwc::CDBParameter::CDBParameter ( )

构造函数

这是这个函数的调用关系图:

成员函数说明

◆ Add()

bool mdwc::CDBParameter::Add ( const std::string & name,
const MidDB_SQLPARA & para )

添加参数

参数
name不能重复
para参数结构
返回
返回true,添加成功,false更新值
这是这个函数的调用关系图:

◆ AddBinData()

bool mdwc::CDBParameter::AddBinData ( const std::string & name,
const uint8_t * value,
int size )

添加二进制数据(最大只能输入48Kb数据,只能作为输入参数使用).

参数
name参数名称
value二进制数据指针
size数据尺寸
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddCString()

bool mdwc::CDBParameter::AddCString ( const std::string & name,
const std::string & value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加数据库CHAR, VARCHAR字符串参数.

参数
name参数名称
value字符参数值
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddCursor()

bool mdwc::CDBParameter::AddCursor ( const std::string & name)

添加数据集(游标)返回参数.

参数
name参数名称
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddDate()

bool mdwc::CDBParameter::AddDate ( const std::string & name,
const std::tm & value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加日期类型.

参数
name参数名称
value字符串日期,YYYY-MM-DD
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddDateTime()

bool mdwc::CDBParameter::AddDateTime ( const std::string & name,
const std::tm & value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加日期时间类型.

参数
name参数名称
valuetm日期时间结构,不带毫秒
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddDateTimeString()

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参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddDecimal()

bool mdwc::CDBParameter::AddDecimal ( const std::string & name,
double value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加十进制小数参数.

参数
name参数名称
value浮点数参数值
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddInt()

bool mdwc::CDBParameter::AddInt ( const std::string & name,
int value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加32位整数值

函数调用图:
这是这个函数的调用关系图:

◆ AddInt64()

bool mdwc::CDBParameter::AddInt64 ( const std::string & name,
int64_t value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加64位整数值.

参数
name参数名称
value参数整数值
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddProcReturnValue()

bool mdwc::CDBParameter::AddProcReturnValue ( const std::string & name,
CDBParameterType DataType = CDBParameterType::MPDT_INT4 )

获取存储过程、函数返回值参数,只能添加一个此类参数.

参数
name参数名称
DataType数据类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddTextData()

bool mdwc::CDBParameter::AddTextData ( const std::string & name,
const std::string & value )

添加Text文本数据, 非Unicode字符集编码(只能输入).

参数
name参数名称
value文本数据
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddTime()

bool mdwc::CDBParameter::AddTime ( const std::string & name,
const std::tm & value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加时间类型.

参数
name参数名称
value字符串时间,HH:MM:SS
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddUString()

bool mdwc::CDBParameter::AddUString ( const std::string & name,
const std::wstring & value,
CDBParameterDirection direction = CDBParameterDirection::Input )

添加数据库NCHAR, NVARCHAR字符串参数.

参数
name参数名称
valueUnicode字符参数值
direction参数输入输出类型
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ AddUTextData()

bool mdwc::CDBParameter::AddUTextData ( const std::string & name,
const std::wstring & value )

添加Unicode字符集编码文本数据(只能输入).

参数
name参数名称
valueUnicode文本数据
返回
成功、失败
函数调用图:
这是这个函数的调用关系图:

◆ Clear()

void mdwc::CDBParameter::Clear ( )

清除所有参数.

这是这个函数的调用关系图:

◆ Count()

int mdwc::CDBParameter::Count ( )

参数个数.

返回
返回个数

◆ CreatePackForMidServer()

std::string mdwc::CDBParameter::CreatePackForMidServer ( bool bOnlyData = false)

合并发送到服务器的参数.

参数
bOnlyData是否只返回数据部分
返回
返回返回合并后的字符串
这是这个函数的调用关系图:

◆ GetParameter()

mdwc::MidDB_SQLPARA mdwc::CDBParameter::GetParameter ( const std::string & name)

取得指定参数.

参数
name参数名称
返回
返回参数结构
这是这个函数的调用关系图:

◆ GetParameterBinValue()

std::shared_ptr< std::vector< uint8_t > > mdwc::CDBParameter::GetParameterBinValue ( const std::string & name)

取得指定参数转换二进制数据.

参数
name参数名称
返回
二进制数据缓存
这是这个函数的调用关系图:

◆ GetParameterDateTimeValue()

std::tm mdwc::CDBParameter::GetParameterDateTimeValue ( const std::string & name)

取得指定参数转换为日期时间.

参数
name参数名称
返回
返回日期时间结构
函数调用图:
这是这个函数的调用关系图:

◆ GetParameterDecimalValue()

double mdwc::CDBParameter::GetParameterDecimalValue ( const std::string & name)

取得指定参数转换十进制小数.

参数
name参数名称
返回
返回浮点数
这是这个函数的调用关系图:

◆ GetParameterInt64Value()

int64_t mdwc::CDBParameter::GetParameterInt64Value ( const std::string & name)

取得指定参数转换为64位整数.

参数
name参数名称
返回
返回64位整数
这是这个函数的调用关系图:

◆ GetParameterIntValue()

int mdwc::CDBParameter::GetParameterIntValue ( const std::string & name)

取得指定参数转换为32位整数.

参数
name参数名称
返回
返回整数
这是这个函数的调用关系图:

◆ GetParameterStringValue()

std::string mdwc::CDBParameter::GetParameterStringValue ( const std::string & name)

取得指定参数转换为字符串.

参数
name参数名称
返回
返回字符数据
这是这个函数的调用关系图:

◆ GetParameterTextValue()

std::string mdwc::CDBParameter::GetParameterTextValue ( const std::string & name)

取得大文本数据.

参数
name参数名称
返回
这是这个函数的调用关系图:

◆ GetParaName()

std::string mdwc::CDBParameter::GetParaName ( int index)

取得指定序号位置的参数名.

参数
index参数序号
返回
返回字符数据
这是这个函数的调用关系图:

◆ operator[]() [1/2]

mdwc::MidDB_SQLPARA & mdwc::CDBParameter::operator[] ( const std::string & name)

直接按名称修改参数值.

参数
name参数名称
返回
返回参数结构
这是这个函数的调用关系图:

◆ operator[]() [2/2]

mdwc::MidDB_SQLPARA & mdwc::CDBParameter::operator[] ( int index)

直接按序号修改参数值.

参数
index参数序号
返回
返回参数结构

◆ RemoveParameter()

bool mdwc::CDBParameter::RemoveParameter ( const std::string & name)

移除指定的参数.

参数
name参数名称
返回
成功、失败
这是这个函数的调用关系图:

◆ SetParameterValue()

bool mdwc::CDBParameter::SetParameterValue ( const std::string & name,
SQLPARAVAL value )

修改指定参数值.

参数
name参数名称
value参数容器值
返回
成功、失败
这是这个函数的调用关系图:

类成员变量说明

◆ HaveReturnParaData

bool mdwc::CDBParameter::HaveReturnParaData
protected

是否有返回参数数据

◆ InPackMerage

bool mdwc::CDBParameter::InPackMerage

合并为一个中间件协议参数,与中间件业务脚本中的接收参数对应

◆ m_Parameters

std::map<std::string, MidDB_SQLPARA> mdwc::CDBParameter::m_Parameters
protected

内部参数存储

◆ m_ParaNameOrders

std::vector<std::string> mdwc::CDBParameter::m_ParaNameOrders
protected

保存参数顺序


该类的文档由以下文件生成:
  • E:/GreatMIMP.Linux.Client/MDWClient/CDBParameter.h
  • E:/GreatMIMP.Linux.Client/MDWClient/CDBParameter.cpp