c++ - mysql resultset is always null -


Unsolved question followup:

This result sheet is always null and the connection is alive. VS2013 Debugger says that mysqlcppconn.dll does not have any debugging symbols.

Tested the query on a MySQL console and it worked fine, return it to 1 .

  CDBase :: CDBase (Cstits * Settings) {settings = settings; {Connection * con = get_driver_instance () - & gt; Try Connect ("", "", ""); Elections & gt; SetSchema ("hyperbot"); Cout & lt; & Lt; "Linked." & Lt; & Lt; Andal & lt; & Lt; Endl; Cout & lt; & Lt; "Checking with the database extremely important ..." & lt; & Lt; Endl; If (! Verification (election,> get_channel (), settings- & gt; get_hyper_key ())) {cout & lt; & Lt; "Verification failed." & Lt; & Lt; Endl; CFunctions :: ExitWithTimeout (5000); } Uninstall; } Grip (SKL :: Eclipse and A) {COT & LT; & Lt; "#Error: SQLException" & lt; & Lt; __FILE__; Cout & lt; & Lt; "(" & Lt; <__FUNCTION__  Execute (from dark_souls2_widgets "Select COUNT (*)); res = stmt-> getResultSet (); If (res == NULL) {return false;} while (res-> Next ()) {cout & Lt; <-> getInt (1);} delete STMT; delete rij; / * sql :: results set * res; sql :: readystation * prep_stmt; prep_stmt = con- & gt; ready statement (select " COUNT (*) from dark_souls2_widgets where channel =? And hyper_key =? "); Prep_stmt-> Setstring (1, channel); Prep_stmt-> Setstring (2, hyper_key); prep_stmt- & gt; executed; Res = prep_stmt-> GetResultSet (); Delete Ridge; Delete PRE_STMT; * / Description is False;} CDBase :: ~ CDBase () {}  

I also get these strange warnings on the compilation:

  1> c: \ program files (x86) \ mysql \ mysql connector c ++ 1.1.3 \ Include \ cppconn \ sqlstring.h (38): Warning C4251: 'sql :: SQLString :: realStr': class' std :: basic_string & lt; char; std :: char_traits & lt; char & gt; std :: Suppressive & lt; four & gt; & gt; class 'sql :: SQLString' 1 & gt; C: \ Program Files (x86) \ mysql \ mysql connector requires DLL-Interface that is used by customers of c ++ 1.1.3 \ include \ mysql_driver.h (52): Warning C4251: 'Sql :: Mysql :: MySQL_Driver :: proxy ': class' boost :: scoped_ptr & lt; Sql :: mysql :: Native API :: Username & gt; Class 'sql :: mysql :: MySQL_Driver' 1 & gt; C: \ Program Files (x86) \ mysql \ mysql connector requires DLL-Interface that is used by client of c ++ 1.1.3 \ include \ mysql_connection.h (165) I: Alert C4251: 'sql :: mysql :: MySQL_Connection :: Proxy ': class' boost :: shared_ptr & lt; Sql :: mysql :: NativeApi :: Native Connection & gt; Class 'sql :: mysql :: MySQL_Connection' 1 & gt; C: \ Program Files (x86) \ mysql \ mysql connector c ++ 1.1.3 \ include \ mysql_connection.h (16 9) requires the DLL-interface used by the client I: Warning C4251: 'sql :: mysql :: MySQL_Connection :: service ': class' boost :: scoped_ptr & lt; Sql :: mysql :: MySQL_Statement & gt; Category 'sql :: mysql :: MySQL_Connection' 1 & gt; C: \ Program Files (x86) \ mysql \ mysql connector c ++ 1.1.3 \ include \ cppconn \ exception.h requires the DLL-interface used by the client 61): Warning C4251: 'sql: : SQLxception :: sql_state ': Category' std :: basic_string & lt; Char, std :: char_traits & lt; Char & gt ;, std :: allocator & lt; Char & gt; & Gt; Class SQL: DLL-Interface used by customers of SQL Exceptions is required  

It may be related to

whose original meaning is that you have

  #define CPPCONN_LIB_BUILD 1  

in your code May have to be inserted. However, not sure.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -