chaoyli commented on a change in pull request #2685: add cpp connect sample URL: https://github.com/apache/incubator-doris/pull/2685#discussion_r364031592
########## File path: samples/connect/cpp/doris.h ########## @@ -15,24 +15,26 @@ // specific language governing permissions and limitations // under the License. -#ifndef _MYDB_H -#define _MYDB_H -#include<iostream> -#include<string> -#include<mysql/mysql.h> -using namespace std; +#ifndef SAMPLES_CONNECT_CPP_DORIS_H +#define SAMPLES_CONNECT_CPP_DORIS_H +#include <iostream> +#include <string> +#include <mysql/mysql.h> -class MyDB +using std::string; + +class Doris { public: - MyDB(); - ~MyDB(); - bool initDB(string host,string user,string passwd,string db_name,int port,string sock); // connect to mysql - bool exeSQL(string sql); // excute sql + Doris(); + ~Doris(); + bool initDoris(const string& host, const string& user, const string& passwd, + const string& db_name, int port, const string& sock); // connect to doris + bool exeSQL(const string& sql); // excute sql private: - MYSQL *mysql; - MYSQL_RES *result; - MYSQL_ROW row; + MYSQL *doris; // mysql handle Review comment: MYSQL* doris; MYSQL_RES* result; ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org