fastdo  0.6.16
eiendb::DbStatement类 参考

数据库语句类通用实现 更多...

#include <eiendb_base.hpp>

类 eiendb::DbStatement 继承关系图:
eiendb::DbStatement 的协作图:

Public 成员函数

 DbStatement (IDbConnection *cnn)
 
 DbStatement (IDbConnection *cnn, winux::String const &sql, winux::Mixed const &params=winux::mxNull)
 
virtual bool build (winux::String const &sql, winux::Mixed const &params=winux::mxNull) override
 建立一个SQL语句,params可以是Array或者Collection类型 更多...
 
virtual bool bind (size_t paramIndex, winux::Mixed const &val) override
 绑定参数,按参数索引 更多...
 
virtual bool bind (winux::String const &paramName, winux::Mixed const &val) override
 绑定参数,按参数名 更多...
 
 operator bool () const
 
IDbConnectiongetCnn () const
 
winux::String const & getSql ()
 
winux::Mixed const & getParam (size_t paramIndex) const
 
winux::Mixed const & getParam (winux::String const &paramName) const
 
- Public 成员函数 继承自 eiendb::IDbStatement
virtual ~IDbStatement ()
 

详细描述

数据库语句类通用实现

在文件 eiendb_base.hpp339 行定义.

构造及析构函数说明

eiendb::DbStatement::DbStatement ( IDbConnection cnn)
eiendb::DbStatement::DbStatement ( IDbConnection cnn,
winux::String const &  sql,
winux::Mixed const &  params = winux::mxNull 
)

成员函数说明

virtual bool eiendb::DbStatement::build ( winux::String const &  sql,
winux::Mixed const &  params = winux::mxNull 
)
overridevirtual

建立一个SQL语句,params可以是Array或者Collection类型

重载 eiendb::IDbStatement .

virtual bool eiendb::DbStatement::bind ( size_t  paramIndex,
winux::Mixed const &  val 
)
overridevirtual

绑定参数,按参数索引

参数
paramIndex参数索引起始为1

重载 eiendb::IDbStatement .

virtual bool eiendb::DbStatement::bind ( winux::String const &  paramName,
winux::Mixed const &  val 
)
overridevirtual

绑定参数,按参数名

参数
paramName参数名前需加':'

重载 eiendb::IDbStatement .

eiendb::DbStatement::operator bool ( ) const
inline

在文件 eiendb_base.hpp349 行定义.

IDbConnection* eiendb::DbStatement::getCnn ( ) const
inline

在文件 eiendb_base.hpp350 行定义.

winux::String const& eiendb::DbStatement::getSql ( )
winux::Mixed const& eiendb::DbStatement::getParam ( size_t  paramIndex) const
winux::Mixed const& eiendb::DbStatement::getParam ( winux::String const &  paramName) const

该类的文档由以下文件生成: