|
|
|
@ -1,14 +1,11 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <mysql_connection.h>
|
|
|
|
|
|
|
|
#include <driver.h>
|
|
|
|
#include <driver.h>
|
|
|
|
#include <exception.h>
|
|
|
|
|
|
|
|
#include <resultset.h>
|
|
|
|
|
|
|
|
#include <statement.h>
|
|
|
|
#include <statement.h>
|
|
|
|
|
|
|
|
|
|
|
|
using namespace sql;
|
|
|
|
using namespace sql;
|
|
|
|
using namespace std;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
int main(void){
|
|
|
|
int main(void){
|
|
|
|
|
|
|
|
|
|
|
|
Driver *driver;
|
|
|
|
Driver *driver;
|
|
|
|
Connection *con;
|
|
|
|
Connection *con;
|
|
|
|
Statement *stmt;
|
|
|
|
Statement *stmt;
|
|
|
|
@ -22,15 +19,15 @@ int main(void){
|
|
|
|
|
|
|
|
|
|
|
|
while (res->next()) {
|
|
|
|
while (res->next()) {
|
|
|
|
cout << "\t... MySQL replies: ";
|
|
|
|
cout << "\t... MySQL replies: ";
|
|
|
|
/* Access column data by alias or column name */
|
|
|
|
|
|
|
|
cout << res->getString("seconds") << endl;
|
|
|
|
cout << res->getString("seconds") << endl;
|
|
|
|
cout << "\t... MySQL says it again: ";
|
|
|
|
cout << "\t... MySQL says it again: ";
|
|
|
|
/* Access column data by numeric offset, 1 is the first column */
|
|
|
|
|
|
|
|
cout << res->getString(1) << endl;
|
|
|
|
cout << res->getString(1) << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
delete res;
|
|
|
|
delete res;
|
|
|
|
delete stmt;
|
|
|
|
delete stmt;
|
|
|
|
delete con;
|
|
|
|
delete con;
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|