Forum Stats

  • 3,734,162 Users
  • 2,246,899 Discussions
  • 7,857,143 Comments

Discussions

About ResultSet::getColumnListMetaData () function to release collapse proble

Scene: when I perform a SQL statements (such as select * from table name), want to pass the ResultSet results were obtained after obtaining the result set column names, so I have a function (ResultSet: : getColumnListMetaData ()) can be used. However, after being used in the local function, an interrupt error will occur after the end of the local function. I doubt whether the release of vector fails.


The enclosed Demo:

int main()

{

oracle::occi::Environment *env = NULL;

oracle::occi::Connection *conn = NULL;

oracle::occi::Statement *stmt = NULL;

oracle::occi::ResultSet *res =NULL;



char usrName[] = "scott";

char usrPwd[] = "BRAnychat";

char connectStr[] = "192.168.13.242:1521/orcl";

env = Environment::createEnvironment();

conn = env->createConnection(usrName,usrPwd,connectStr);

string sqlStmt="select * from tb_distributedlock";

stmt = conn->createStatement(sqlStmt);

res = stmt->executeQuery(sqlStmt);

{

vector<MetaData> metafield = res->getColumnListMetaData();

}



stmt->closeResultSet(res);

env->terminateConnection(conn);

Environment::terminateEnvironment(env);


return 0;

}

Sign In or Register to comment.