MySQL使用connector C/C+读取二进制字段,两种方法:
用getString- vector<char> vec;
- while (pResultSet->next())
- {
- string str = pResultSet->getString("data");
- vec.insert(vec.end(), str.begin(), str.end());
- }
用getBlob- vector<char> vecALL;
- while (pResultSet->next())
- {
- istream *pis= pResultSet->getBlob("data");
- pis->seekg(0, ios::end);
- int sz = pis->tellg();
- pis->seekg(ios::beg);
- vector<char> vecTemp;
- vecTemp.resize(sz);
- pis->read(&vecTemp[0], sz);
- vecALL.insert(vec.end(), vecTemp.begin(),vecTemp.end());
- }
ORA-01861: literal does not match format stringMySQL快速插入大批量数据存储过程相关资讯 MySQL数据库教程
- MySQL 处理非法数据 (04/09/2013 08:06:28)
- MySQL关于timestamp和mysqldump的 (12/16/2012 13:25:41)
- MySQL保证数据完整性 (12/16/2012 12:00:35)
| - ERROR 1130: mysql 1130连接错误的 (12/16/2012 13:29:08)
- MySQL数据库教程:管理数据库和表( (12/16/2012 12:47:02)
- MySQL快速插入大批量数据存储过程 (11/05/2012 19:04:04)
|
本文评论 查看全部评论 (0)