易截截图软件、单文件、免安装、纯绿色、仅160KB

实例讲解如何使用C++操作MySQL数据库类

 
  用C++操作MySQL数据库类:
  注释:这几个类对处理不是很大数据量的操作是很理想的, 但不适宜特大型的数据的查询,因为源码中将查询到的数据直接放入了内存。
  /*
  * project:
  * 通用模块 ( 用 c++ 处理 mysql 数据库类,像ADO )
  *
  * description:
  *
  * 通过DataBase,RecordSet,Record,Field类,实现对mysql数据库的操作
  * 包括连接、修改、添加、删除、查询等等,像ADO一样操作数据库,使
  * 用方便
  *
  * ( the end of this file have one sample,
  * welcom to use... )
  *
  *
  * file:zlb_mysql.h
  *
  * author: @ zlb
  *
  * time:2005-12-12
  *
  *
  *
  --*/
  #ifndef ZLB_MYSQL_H
  #define ZLB_MYSQL_H
  #include "mysql.h"
  #include
  #include
  #include
  using namespace std;
  namespace zlb_mysql{
  /*
  * 字段操作
  */
  class Field
  {
  public :
  /* 字段名称 */
  vector m_name;
  /* 字段类型 */
  vector m_type;
  public :
  Field();
  ~Field();
  /* 是否是数字 */
  bool IsNum(int num);
  /* 是否是数字 */
  bool IsNum(string num);
  /* 是否是日期 */
  bool IsDate(int num);
  /* 是否是日期 */
  bool IsDate(string num);
  /* 是否是字符 */
  bool IsChar(int num);
  /* 是否是字符 */
  bool IsChar(string num);
  /* 是否为二进制数据 */
  bool IsBlob(int num);
  /* 是否为二进制数据 */
  bool IsBlob(string num);
  /* 得到指定字段的序号 */
  int GetField_NO(string field_name);
  };
  /*
  * 1 单条记录
  * 2 [int ]操作 [""]操作
  */
  class Record
  {
  public:
  /* 结果集 */
  vector m_rs;
  /* 字段信息 占用4字节的内存 当记录数很大是回产生性能问题 */
  Field *m_field;
  public :
  Record(){};
  Record(Field* m_f);
  ~Record();
  void SetData(string value);
  /* [""]操作 */
  string operator[](string s);
  string operator[](int num);
  /* null值判断 */
  bool IsNull(int num);
  bool IsNull(string s);
  /* 用 value


相关文档:

转载:Hadoop 应该用C++实现,而不是Java

http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......

XP下Apache php mysql phpmyAdmin的安装与配置

初学php,需要搭建其开发环境。由于版本更替等原因,网上的方法几乎一人一个样,让人无所适从。昨天花了一晚上时间才在XP下配置好,现将其整理出来,希望能对别人有用。(2007-11-21)
 
一、 下载软件。
1. 下载apache_2.0.55-win32-x86-no_ssl.msi,右键用迅雷点击此处下载(直接点击不行)。
2. 下载php-5 ......

自动化测试中Python与C/C++的混合使用


背景
项目的
自动化测试中已经使用了基于Python
脚本的框架,自动化过程中最关键的问题就是如何实现桩模块。运用
Python
强大的功能,实现任何桩模块都是可能的,但是是否必须完全使用
Python
实现模块逻辑,成本是一个决定性因素。在桩模块逻辑简单的情况下,使用
Python
模拟模块逻辑不但使自动化测试的结构清 ......

mysql 中数学函数的使用

所有的数学函数在一个出错的情况下返回NULL。 

单目减。改变参数的符号。 
mysql> select - 2; 
注意,如果这个操作符与一个BIGINT使用,返回值是一个BIGINT!这意味着你应该避免在整数上使用-,那可能有值-2^63! 
ABS(X) 
返回X的绝对值。 
mysql ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号