mysql++ Query

mysqlpp:: Query类存储了Connection的指针,可以用它进行SQL语句的增删改查。

 

连上数据库后,使用mysqlpp::Connection::query()获取Query对象

Query有一些最基本的用法,包括

  • 直接利用已经拼凑好了的SQL语句调用mysqlpp::Query::exec*(),mysqlpp::Query::store()或者mysqlpp::Query::use()
  • 使用ostream接口,像构造cout一样构造SQL语句,然后再调用mysqlpp::Query::exec*(),mysqlpp::Query::store()或者mysqlpp::Query::use()
  • 类似于printf一样使用template queries
  • 类似于Hibernate那样使用Specialized SQL Structures feature(SSQLS)

 

posted @ 2016-09-12 20:52  滴水瓦  阅读(666)  评论(0编辑  收藏  举报