11 env = oracle::occi::Environment::createEnvironment (oracle::occi::Environment::DEFAULT);
12 char* c_user = ::getenv(
"CSCMAP_AUTH_USER");
13 char* c_pass = ::getenv(
"CSCMAP_AUTH_PASSWORD");
16 con =
env->createConnection (db_user,db_pass,
"cms_orcoff_prod");
17 std::cout <<
"Connection to cable DB is done." << std::endl;
24 env->terminateConnection (
con);
25 oracle::occi::Environment::terminateEnvironment (
env);
29 float *cfeb_length,
std::string *cfeb_rev,
float *alct_length,
30 std::string *alct_rev,
float *cfeb_tmb_skew_delay,
float *cfeb_timing_corr)
32 oracle::occi::Statement *stmt =
con->createStatement();
33 stmt->setSQL(
"begin cms_emu_cern.cable_read.cable(:1, :2, :3, :4, :5, :6, :7, :8); end;");
55 stmt->setInt (1, chamber_index);
56 stmt->registerOutParam(2, oracle::occi::OCCISTRING, 9);
57 stmt->registerOutParam(3, oracle::occi::OCCIFLOAT);
58 stmt->registerOutParam(4, oracle::occi::OCCISTRING, 1);
59 stmt->registerOutParam(5, oracle::occi::OCCIFLOAT);
60 stmt->registerOutParam(6, oracle::occi::OCCISTRING, 1);
61 stmt->registerOutParam(7, oracle::occi::OCCIFLOAT);
62 stmt->registerOutParam(8, oracle::occi::OCCIFLOAT);
66 *chamber_label = stmt->getString(2);
67 *cfeb_length = stmt->getFloat(3);
68 *cfeb_rev = stmt->getString(4);
69 *alct_length = stmt->getFloat(5);
70 *alct_rev = stmt->getString(6);
71 *cfeb_tmb_skew_delay = stmt->getFloat(7);
72 *cfeb_timing_corr = stmt->getFloat(8);
74 con->terminateStatement (stmt);
oracle::occi::SQLException SQLException
void cable_read(int chamber_index, std::string *chamber_label, float *cfeb_length, std::string *cfeb_rev, float *alct_length, std::string *alct_rev, float *cfeb_tmb_skew_delay, float *cfeb_timing_corr)
oracle::occi::Environment * env
oracle::occi::Connection * con