11 char *c_user = std::getenv(
"CSCMAP_AUTH_USER");
12 char *c_pass = std::getenv(
"CSCMAP_AUTH_PASSWORD");
15 con =
env->createConnection(db_user, db_pass,
"devdb");
16 std::cout <<
"Connection to mapping DB is done." << std::endl;
22 env->terminateConnection(
con);
23 oracle::occi::Environment::terminateEnvironment(
env);
31 int *first_strip_index,
32 int *strips_per_layer,
34 oracle::occi::Statement *stmt =
con->createStatement();
35 stmt->setSQL(
"begin cscmap.chamber0(:1, :2, :3, :4, :5, :6, :7, :8); end;");
37 stmt->setInt(1, crate0);
39 stmt->registerOutParam(3, oracle::occi::OCCISTRING, 10);
40 stmt->registerOutParam(4, oracle::occi::OCCIINT);
41 stmt->registerOutParam(5, oracle::occi::OCCIINT);
42 stmt->registerOutParam(6, oracle::occi::OCCIINT);
43 stmt->registerOutParam(7, oracle::occi::OCCIINT);
44 stmt->registerOutParam(8, oracle::occi::OCCIINT);
48 *chamber_id = stmt->getString(3);
49 *chamber_num = stmt->getInt(4);
50 *chamber_index = stmt->getInt(5);
51 *first_strip_index = stmt->getInt(6);
52 *strips_per_layer = stmt->getInt(7);
55 con->terminateStatement(stmt);
63 int *first_strip_index,
64 int *strips_per_layer,
66 oracle::occi::Statement *stmt =
con->createStatement();
67 stmt->setSQL(
"begin cscmap.chamber(:1, :2, :3, :4, :5, :6, :7, :8); end;");
69 stmt->setInt(1, crate);
71 stmt->registerOutParam(3, oracle::occi::OCCISTRING, 10);
72 stmt->registerOutParam(4, oracle::occi::OCCIINT);
73 stmt->registerOutParam(5, oracle::occi::OCCIINT);
74 stmt->registerOutParam(6, oracle::occi::OCCIINT);
75 stmt->registerOutParam(7, oracle::occi::OCCIINT);
76 stmt->registerOutParam(8, oracle::occi::OCCIINT);
80 *chamber_id = stmt->getString(3);
81 *chamber_num = stmt->getInt(4);
82 *chamber_index = stmt->getInt(5);
83 *first_strip_index = stmt->getInt(6);
84 *strips_per_layer = stmt->getInt(7);
87 con->terminateStatement(stmt);
96 int *first_strip_index,
97 int *strips_per_layer,
99 oracle::occi::Statement *stmt =
con->createStatement();
100 stmt->setSQL(
"begin cscmap.crate0_proc(:1, :2, :3, :4, :5, :6, :7, :8, :9); end;");
102 stmt->setString(1, chamber_id);
103 stmt->registerOutParam(2, oracle::occi::OCCIINT);
104 stmt->registerOutParam(3, oracle::occi::OCCIINT);
105 stmt->registerOutParam(4, oracle::occi::OCCIINT);
106 stmt->registerOutParam(5, oracle::occi::OCCIINT);
107 stmt->registerOutParam(6, oracle::occi::OCCIINT);
108 stmt->registerOutParam(7, oracle::occi::OCCIINT);
109 stmt->registerOutParam(8, oracle::occi::OCCIINT);
110 stmt->registerOutParam(9, oracle::occi::OCCIINT);
114 *crate0 = stmt->getInt(2);
115 *crate = stmt->getInt(3);
116 *dmb = stmt->getInt(4);
117 *
sector = stmt->getInt(5);
118 *chamber_num = stmt->getInt(6);
119 *chamber_index = stmt->getInt(7);
120 *first_strip_index = stmt->getInt(8);
121 *strips_per_layer = stmt->getInt(9);
123 con->terminateStatement(stmt);
oracle::occi::Environment * env
void chamber_crate(std::string chamber_id, int *crate, int *dmb, int *sector, int *chamber_num, int *crate0, int *first_strip_index, int *strips_per_layer, int *chamber_index)
void crate0_chamber(int crate0, int dmb, std::string *chamber_id, int *chamber_num, int *sector, int *first_strip_index, int *strips_per_layer, int *chamber_index)
oracle::occi::Connection * con
~cscmap() noexcept(false)
void crate_chamber(int crate, int dmb, std::string *chamber_id, int *chamber_num, int *sector, int *first_strip_index, int *strips_per_layer, int *chamber_index)