Hi everyone,
I am pretty new to mysql, but after few hours of research on the Internet I didn't find a solution to my problem.
I installed Mysql (server 5.7 and connector/c++) and configured a first database with one table.
However, following the tutorial, my program crash completely when I try to use execute or executeQuery.
Here is the code :
sql::mysql::MySQL_Driver *driver;
sql::Connection *connection;
sql::Statement *stmt;
driver = sql::mysql::get_mysql_driver_instance();
connection = driver->connect("tcp://127.0.0.1:3306", "root" , "123");
stmt = connection->createStatement();
stmt->executeQuery("USE myDatabase");
stmt->executeQuery("INSERT INTO myTable VALUES (NULL, 1, 307 , 'S')");
It crashes at the first execute (USE...)
As it's pretty basic so I don't get why it doesn't work. The include and dll/lib are correctly linked. As a proof, after creating the connection and using isValid() method works well and confirms there is a connection.
Thank you for your help
I am pretty new to mysql, but after few hours of research on the Internet I didn't find a solution to my problem.
I installed Mysql (server 5.7 and connector/c++) and configured a first database with one table.
However, following the tutorial, my program crash completely when I try to use execute or executeQuery.
Here is the code :
sql::mysql::MySQL_Driver *driver;
sql::Connection *connection;
sql::Statement *stmt;
driver = sql::mysql::get_mysql_driver_instance();
connection = driver->connect("tcp://127.0.0.1:3306", "root" , "123");
stmt = connection->createStatement();
stmt->executeQuery("USE myDatabase");
stmt->executeQuery("INSERT INTO myTable VALUES (NULL, 1, 307 , 'S')");
It crashes at the first execute (USE...)
As it's pretty basic so I don't get why it doesn't work. The include and dll/lib are correctly linked. As a proof, after creating the connection and using isValid() method works well and confirms there is a connection.
Thank you for your help