当值> = 16时,ResultSet-> getString()崩溃 [英] ResultSet ->getString() crashes when value is >=16

查看:69
本文介绍了当值> = 16时,ResultSet-> getString()崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ResultSet *search;
....
....
search= prepareStatement->executeQuery();


while (search->next())
{
cout << "Email Found: " << search->getString("EmailColumn") << endl; //crashes here
}

从上面的代码中,调用 getString()函数实际上从数据库中获取值.但随后它使程序崩溃.它会显示值,然后崩溃程序.

From the code above, calling getString() function actually gets the value from the database. But then it crashes the program. It displays the value then crashes the program.

发现问题,但无法 修复.我不知道这是 bug 还是其他.

I discovered the problem but couldn't fix it. I can't tell if this is a bug or something else.

仅当EmailColumn 中的值的 length more 等于时,才会发生此问题. 16 .如果值的长度小于或等于 15 ,则没有错误.

The problem only happens when the length of the value in the EmailColumn column is more or equals to 16. No error if the length of the value is less or equals to 15.

对此有任何解决方案或解决方法吗?

Any solution or workarounds for this?

推荐答案

我解决了.解决方案是构建自己的C ++连接器并使用其编译的dll文件. Oracle分发的dll是使用我当前使用的其他版本的Visual Studio编译器制作的.这里的第一个答案将向您展示如何自己构建它. MySQL Connector C ++ 64bit从Visual Studio 2012 ?

I solved it. The solution is to build your own C++ Connector and use the dll files it compiles. The dll distributed by Oracle was made with a different version of Visual Studio compiler that I am currently using. The first answer here will show you how to build it yourself. MySQL Connector C++ 64bit build from source in Visual Studio 2012?

这篇关于当值&gt; = 16时,ResultSet-&gt; getString()崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆