???????AddOcci????????

???????AddOcci???????

 

//ListOcci.cc
#include <iostream>
#include <string>
#include <occi.h>
#pragma comment(lib??"oci.lib")
#pragma comment(lib??"ociw32.lib")
#pragma comment(lib??"oraocci10.lib")
using namespace std;
using namespace oracle::occi;
/*******************************
*???????????
*******************************/
int main()
{
Environment *env = Environment::createEnvironment(Environment::OBJECT);
string username = "hahaya";
string userpass = "hahaya";
string connstr = "192.168.0.6:1521/orcl";
Connection *conn = env->createConnection(username?? userpass?? connstr);
Statement *st = conn->createStatement();
st->setSQL("select * from user_info");
ResultSet *rs = st->executeQuery();
while(rs->next())
{
cout << "user id:" << rs->getInt(1) << "user name:" << rs->getString(2) << endl;;
}
st->closeResultSet(rs);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
return 0;
}

???????ListOcci????

???????DelOcci?????