4 #include <samchon/library/TSQLi.hpp> 20 shared_ptr<SQLi> sqli(
new TSQLi());
24 sqli->connect(
"211.239.161.211",
"REDPRINTING_TEST",
"redprinting_test",
"redprinting");
26 auto stmt = sqli->createStatement();
28 wstring name = L
"°í±æµ¿";
29 wstring department = L
"È«º¸ºÎ ;
stmt->prepare(L"INSERT INTO ÇѱÛÅ×À̺í (¹øÈ£, À̸§, ºÎ¼) VALUES (?, ?, ?)", uid, name, department);
stmt->execute();
stmt->executeDirectly(u8"SELECT * FROM ÇѱÛÅ×À̺í");
while (stmt->fetch())
{
int uid = stmt->at<int>(0);
const string &name = stmt->at<string>(1);
const string &department = stmt->at<string>(2);
cout << uid << endl;
cout << name << endl;
cout << department << endl;
}
}
catch (exception &e)
{
cout << e.what() << endl;
}
};
}
}
}";
31 stmt->prepare(L
"INSERT INTO ÇѱÛÅ×À̺í (¹øÈ£, À̸§, ºÎ¼) VALUES (?, ?, ?)", uid, name, department);
34 stmt->executeDirectly(u8
"SELECT * FROM ÇѱÛÅ×À̺í );
while (stmt->fetch())
{
int uid = stmt->at<int>(0);
const string &name = stmt->at<string>(1);
const string &department = stmt->at<string>(2);
cout << uid << endl;
cout << name << endl;
cout << department << endl;
}
}
catch (exception &e)
{
cout << e.what() << endl;
}
};
}
}
}");
38 int uid = stmt->at<
int>(0);
39 const string &name = stmt->at<
string>(1);
40 const string &department = stmt->at<
string>(2);
44 cout << department << endl;
49 cout << e.what() << endl;
A SQL interface for T-SQL.