您的位置:首页 > 其它

terminate called after throwing an instance of 'otl_tmpl_exception<otl_exc, otl_conn, otl_cur>`解决方法

2015-01-16 17:49 956 查看


在linux下用c++连接MySQL或oracle数据库时,若频繁调用otlstream构造函数,发生 terminate called after throwing an instance of 'otl_tmpl_exception<otl_exc, otl_conn, otl_cur>`的问题,其解决方法为:

在调用otl_connect类的void rlogon(const char* connect_str, const int aauto_commit=0)函数时,将aauto_commit的值置为1。

示例代码:
db.rlogon("DSN=my_db;UID=sa;PWD=tiger",1);
其中db为[b]otl_connect类的对象。[/b]

注意:第二参数aauto_commit设置为1,表示数据库事务自动提交;设置为0,表示数据库事务非自动提交。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐