14#include "GaudiKernel/Bootstrap.h"
15#include "GaudiKernel/ISvcLocator.h"
40 const std::string& dbName)
41 : m_readCxt(0), m_writeCxt(0),
42 m_host(host), m_table(table), m_dbName(dbName), m_man(0), m_rdb(0),
44 if (table.compare(
"*") == 0) m_table = std::string(
"$(MYSQL_METATABLE)");
45 if (host.compare(
"*") == 0) m_host = std::string(
"$(MYSQL_HOST)");
49 if (nsub < 0) m_table = std::string(
"metadata");
50 StatusCode sc=Gaudi::svcLocator()->service(
"DatabaseSvc", m_dbsvc,
true);
51 if ( !sc.isSuccess() ) {
52 std::cout <<
"Metadata ERROR ::Could not retrieve the DataBaseSvc" << std::endl;;
60 if (m_man)
delete m_man;
69 user = std::string(
"$(USER)");
71 user = std::string(
"$(USERNAME)");
79 user = std::string(
"");
86 const std::string& user,
87 const std::string& pw, eRet& err,
88 const std::string& dbName) {
96 bool connected = cxt->
open(host, user, pw, dbName);
108 if (m_readCxt == 0) {
113 bool ok = connect(m_readCxt, m_host, std::string(
"guest"),
114 std::string(
"guestpass"), err, m_dbName);
129 bool Metadata::connectWrite(eRet& err) {
130 if (m_writeCxt == 0) {
133 if (m_dbName == std::string(
"calib_test") ) {
134 ok = connect(m_writeCxt, m_host, std::string(
"calib_tester"),
135 std::string(
"udine"), err, m_dbName);
138 ok = connect(m_writeCxt, m_host, std::string(
"calibrator"),
139 std::string(
"calibrator"), err, m_dbName);
146 std::string(
"$(RDBMODELROOT)/xml/")+ m_dbName +
".xml";
147 err = compareSchema(m_writeCxt, schema);
173 const std::string& calibType,
174 const std::string& SftVer,
175 const std::string& cal_ver,
176 const std::string& cal_par,
177 const std::string& rec_alg,
178 const std::string& rec_par,
179 const std::string& machine,
180 const std::string& flavor) {
187 if (ret !=
RETOk)
return ret;
192 std::vector<Assertion::Operator *> conditions;
193 conditions.reserve(8);
196 FIELDTYPEold, FIELDTYPElit);
199 FIELDTYPEold, FIELDTYPElit);
205 FIELDTYPEold, FIELDTYPElit);
207 FIELDTYPEold, FIELDTYPElit);
209 FIELDTYPEold, FIELDTYPElit);
211 FIELDTYPEold, FIELDTYPElit);
213 FIELDTYPEold, FIELDTYPElit);
215 FIELDTYPEold, FIELDTYPElit);
219 std::cout<<
"run no is::"<<s_run<<std::endl;
222 FIELDTYPEold, FIELDTYPElit);
225 FIELDTYPEold, FIELDTYPElit);
227 conditions.push_back(&completeOp);
228 conditions.push_back(&calibTypeOp);
230 conditions.push_back(&sftverOp);
231 conditions.push_back(&calverOp);
232 conditions.push_back(&calparOp);
233 conditions.push_back(&recalgOp);
234 conditions.push_back(&recparOp);
235 conditions.push_back(&machineOp);
236 conditions.push_back(&runfrmOp);
237 conditions.push_back(&runtoOp);
238 ret = doSelect(conditions, orderBy, ser);
244 const std::string& calibType,
245 const std::string& SftVer,
246 const std::string& cal_ver,
247 const std::string& cal_par,
248 const std::string& rec_alg,
249 const std::string& rec_par,
250 const std::string& machine,
251 const std::string& flavor)
259 if (ret !=
RETOk)
return ret;
265 std::vector<Assertion::Operator *> conditions;
266 conditions.reserve(8);
268 FIELDTYPEold, FIELDTYPElit);
272 FIELDTYPEold, FIELDTYPElit);
278 FIELDTYPEold, FIELDTYPElit);
280 FIELDTYPEold, FIELDTYPElit);
282 FIELDTYPEold, FIELDTYPElit);
284 FIELDTYPEold, FIELDTYPElit);
286 FIELDTYPEold, FIELDTYPElit);
288 FIELDTYPEold, FIELDTYPElit);
293 FIELDTYPEold, FIELDTYPElit);
296 FIELDTYPEold, FIELDTYPElit);
298 conditions.push_back(&completeOp);
299 conditions.push_back(&calibTypeOp);
301 conditions.push_back(&sftverOp);
302 conditions.push_back(&calverOp);
303 conditions.push_back(&calparOp);
304 conditions.push_back(&recalgOp);
305 conditions.push_back(&recparOp);
306 conditions.push_back(&machineOp);
307 conditions.push_back(&runfrmOp);
308 conditions.push_back(&runtoOp);
310 return doSelect(conditions, orderBy, ser);
317 std::string& dataFmt,
318 std::string& filename) {
328 colNames[0] =
"data_fmt";
329 colNames[1] =
"data_ident";
330 colNames[2] =
"RunFrom";
331 colNames[3] =
"RunTo";
333 std::string serNoVal;
337 FIELDTYPEold, FIELDTYPElit);
347 results = m_readCxt->
select(m_table, colNames, orderBy, &whereClause);
358 std::vector<std::string> fields;
359 std::cout<<
"test id \\"<<std::endl;
362 filename = fields[1];
363 std::string runfrm,runto;
372 if ((dataFmt ==
"") || (filename ==
""))
return RETBadValue;
379 std::string& calParVer,
382 std::string& sftver) {
387 if(sftver==
"default")
388 sftver = getenv(
"BES_RELEASE");
389 const char* SftVer = sftver.c_str();
391 if(calParVer!=
"default"){
392 const char* calpar = calParVer.c_str();
393 sprintf(stmt1,
"select BarTofPar,EndTofPar,TofConPar,BarTof,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from TofCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
395 if(calParVer==
"default"){
397 sprintf(stmt1,
"select BarTofPar,EndTofPar,TofConPar,BarTof,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from TofCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
400 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
402 std::cout<<
"ERROR:error searching TOF calibration Data in the database with: "<<stmt1<<std::endl;
412 std::string& calParVer,
415 std::string& sftver) {
421 if(sftver==
"default")
422 sftver = getenv(
"BES_RELEASE");
423 const char* SftVer = sftver.c_str();
425 if(calParVer!=
"default"){
426 const char* calpar = calParVer.c_str();
427 sprintf(stmt1,
"select LayTree,BoxTree,StrTree,ResTree,ClsTree,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MucCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
430 if(calParVer==
"default"){
432 sprintf(stmt1,
"select LayTree,BoxTree,StrTree,ResTree,ClsTree,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MucCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
436 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
438 std::cout<<
"ERROR:error searching MUC calibration Data in the database with: "<<stmt1<<std::endl;
449 std::string& calParVer,
452 std::string& sftver) {
458 if(sftver==
"default")
459 sftver = getenv(
"BES_RELEASE");
460 const char* SftVer = sftver.c_str();
463 if(calParVer!=
"default"){
464 const char* calpar = calParVer.c_str();
465 sprintf(stmt1,
"select NewXtTrees,XtTree,QtTree,T0Tree,SdTree,R2tTrees,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MdcCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = '%s'",SftVer,run_No,run_No,calpar);}
467 if(calParVer==
"default"){
469 sprintf(stmt1,
"select NewXtTrees,XtTree,QtTree,T0Tree,SdTree,R2tTrees,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MdcCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);}
471 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
473 std::cout<<
"ERROR:error searching Mdc calibration Data in the database with: "<<stmt1<<std::endl;
486 std::string& calParVer,
489 std::string& sftver) {
494 if(sftver==
"default")
495 sftver = getenv(
"BES_RELEASE");
496 const char* SftVer = sftver.c_str();
498 if(calParVer!=
"default"){
499 const char* calpar = calParVer.c_str();
500 sprintf(stmt1,
"select DigiCalibConst,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EmcCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
503 if(calParVer==
"default"){
505 sprintf(stmt1,
"select DigiCalibConst,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EmcCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
508 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
510 std::cout<<
"ERROR:error searching EMC calibration Data in the database with: "<<stmt1<<std::endl;
520 std::string& calParVer,
523 std::string& sftver) {
528 if(sftver==
"default")
529 sftver = getenv(
"BES_RELEASE");
530 const char* SftVer = sftver.c_str();
532 if(calParVer!=
"default"){
533 const char* calpar = calParVer.c_str();
534 sprintf(stmt1,
"select DriftDist,EntranceAng,MeanGain,GasGain,LayerGain,Resolution,WireGain,ZDep,RunGain,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from DedxCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
537 if(calParVer==
"default"){
539 sprintf(stmt1,
"select DriftDist,EntranceAng,MeanGain,GasGain,LayerGain,Resolution,WireGain,ZDep,RunGain,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from DedxCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
542 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
544 std::cout<<
"ERROR:error searching Dedx calibration Data in the database with: "<<stmt1<<std::endl;
554 std::string& calParVer,
557 std::string& sftver) {
562 if(sftver==
"default")
563 sftver = getenv(
"BES_RELEASE");
564 const char* SftVer = sftver.c_str();
566 if(calParVer!=
"default"){
567 const char* calpar = calParVer.c_str();
568 sprintf(stmt1,
"select EsTimeH2,EsTimeH9,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EsTimeCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
571 if(calParVer==
"default"){
572 sprintf(stmt1,
"select EsTimeH2,EsTimeH9,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EsTimeCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
574 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
576 std::cout<<
"ERROR:error searching EsTime calibration Data in the database with: "<<stmt1<<std::endl;
588 std::string& calParVer,
591 std::string& sftver) {
596 if(sftver==
"default")
597 sftver = getenv(
"BES_RELEASE");
598 const char* SftVer = sftver.c_str();
600 if(calParVer!=
"default"){
601 const char* calpar = calParVer.c_str();
602 sprintf(stmt1,
"select BarTofPar,EndTofPar,TofConPar,BarTof,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EstTofCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
604 if(calParVer==
"default"){
606 sprintf(stmt1,
"select BarTofPar,EndTofPar,TofConPar,BarTof,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from EstTofCalConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
609 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
611 std::cout<<
"ERROR:error searching EstTOF calibration Data in the database with: "<<stmt1<<std::endl;
621 std::string& calParVer,
624 std::string& sftver) {
629 if(sftver==
"default")
630 sftver = getenv(
"BES_RELEASE");
631 const char* SftVer = sftver.c_str();
633 if(calParVer!=
"default"){
634 const char* calpar = calParVer.c_str();
635 sprintf(stmt1,
"select BTofSim,ETofSim,SimConstants,RunFrom,RunTo,TofSimParVer,FileName,Status,SftVer from TofSimSvc where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and TofSimParVer = %s",SftVer,run_No,run_No,calpar);
637 if(calParVer==
"default"){
639 sprintf(stmt1,
"select BTofSim,ETofSim,SimConstants,RunFrom,RunTo,TofSimParVer,FileName,Status,SftVer from TofSimSvc where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by TofSimParVer desc",SftVer,run_No,run_No);
643 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
645 std::cout<<
"ERROR:error searching TOFSim calibration Data in the database with: "<<stmt1<<std::endl;
656 std::string& calParVer,
659 std::string& sftver) {
664 if(sftver==
"default")
665 sftver = getenv(
"BES_RELEASE");
666 const char* SftVer = sftver.c_str();
668 if(calParVer!=
"default"){
669 const char* calpar = calParVer.c_str();
670 sprintf(stmt1,
"select TH1F_Col,bin,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from DedxSim where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
672 if(calParVer==
"default"){
673 sprintf(stmt1,
"select TH1F_Col,bin,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from DedxSim where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
676 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
678 std::cout<<
"ERROR:error searching DedxSim calibration Data in the database with: "<<stmt1<<std::endl;
689 std::string& calParVer,
692 std::string& sftver) {
697 if(sftver==
"default")
698 sftver = getenv(
"BES_RELEASE");
699 const char* SftVer = sftver.c_str();
701 if(calParVer!=
"default"){
702 const char* calpar = calParVer.c_str();
703 sprintf(stmt1,
"select AlignEndPlate,WirePos,WireTension,RunFrom,RunTo,MdcAlignVer,AlignEPFileName,Status,SftVer from MdcAlignment where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and MdcAlignVer = %s",SftVer,run_No,run_No,calpar);
705 if(calParVer==
"default"){
707 sprintf(stmt1,
"select AlignEndPlate,WirePos,WireTension,RunFrom,RunTo,MdcAlignVer,AlignEPFileName,Status,SftVer from MdcAlignment where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by MdcAlignVer desc",SftVer,run_No,run_No);
710 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
712 std::cout<<
"ERROR:error searching MdcAlignment calibration Data in the database with: "<<stmt1<<std::endl;
722 std::string& calParVer,
725 std::string& sftver) {
730 if(sftver==
"default")
731 sftver = getenv(
"BES_RELEASE");
732 const char* SftVer = sftver.c_str();
734 if(calParVer!=
"default"){
735 const char* calpar = calParVer.c_str();
736 sprintf(stmt1,
"select WireEff,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MdcDataConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
738 if(calParVer==
"default"){
739 sprintf(stmt1,
"select WireEff,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from MdcDataConst where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
742 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
744 std::cout<<
"ERROR:error searching MdcDataConst Data in the database with: "<<stmt1<<std::endl;
754 std::string& calParVer,
757 std::string& sftver) {
762 if(sftver==
"default")
763 sftver = getenv(
"BES_RELEASE");
764 const char* SftVer = sftver.c_str();
766 if(calParVer!=
"default"){
767 const char* calpar = calParVer.c_str();
768 sprintf(stmt1,
"select BarBoardNum,EndBoardNum,QELecBarParEast,QELecBarParWest,QELecEndPar,SimQELecBarParEast,SimQELecBarParWest,SimQELecEndPar,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from TofQELec where SftVer = '%s' and RunFrom <= %d and RunTo >= %d and CalParVer = %s",SftVer,run_No,run_No,calpar);
770 if(calParVer==
"default"){
771 sprintf(stmt1,
"select BarBoardNum,EndBoardNum,QELecBarParEast,QELecBarParWest,QELecEndPar,SimQELecBarParEast,SimQELecBarParWest,SimQELecEndPar,RunFrom,RunTo,CalParVer,FileName,Status,SftVer from TofQELec where SftVer = '%s' and RunFrom <= %d and RunTo >= %d order by CalParVer desc",SftVer,run_No,run_No);
773 int row_no = m_dbsvc->
query(
"offlinedb", stmt1, res);
775 std::cout<<
"ERROR:error searching TofQElec calibration Data in the database with: "<<stmt1<<std::endl;
778 std::cout<<
"metadata ok"<<std::endl;
811Metadata::doSelect(std::vector<rdbModel::Assertion::Operator *>& conditions,
818 colNames[0] =
"ser_no";
833 results = m_readCxt->
select(m_table, colNames, orderBy, &whereClause);
841 std::cout<<
"no results"<<std::endl;
847 std::cout<<
"There are results"<<std::endl;
850 conditions.pop_back();
851 std::cout<<
"no results"<<std::endl;
854 std::vector<std::string> fields;
867 const std::string& flavor,
868 const std::string& calib_type,
869 const std::string& data_ident,
870 const std::string& data_fmt,
871 unsigned int& runfrm,
873 const std::string& input_desc,
874 const std::string& notes,
875 const std::string& proc_level,
876 const std::string& locale,
877 const std::string& fmt_version,
878 const std::string& completion)
887 if (ret !=
RETOk)
return 0;
895 nullCols.reserve(16);
897 if (inst.size() * calib_type.size() * flavor.size() * data_fmt.size()
898 * data_ident.size() * proc_level.size() * completion.size()
899 * locale.size() == 0) {
902 cols.push_back(
"calib_type"); vals.push_back(calib_type);
904 cols.push_back(
"data_fmt"); vals.push_back(data_fmt);
905 cols.push_back(
"data_ident"); vals.push_back(data_ident);
906 cols.push_back(
"status"); vals.push_back(completion);
907 std::string s_runfrm,s_runto;
910 cols.push_back(
"RunFrom"); vals.push_back(s_runfrm);
911 cols.push_back(
"RunTo"); vals.push_back(s_runto);
914 if (input_desc.size() > 0 ) {
915 cols.push_back(
"input_desc"); vals.push_back(input_desc);
916 }
else nullCols.push_back(
"input_desc");
918 if (notes.size() > 0 ) {
919 cols.push_back(
"notes"); vals.push_back(notes);
920 }
else nullCols.push_back(
"notes");
922 if (fmt_version.size() > 0 )
924 cols.push_back(
"fmt_version");
925 vals.push_back(fmt_version);
929 cols.push_back(
"creator"); vals.push_back(
"Metadata::registerCalib");
932 cols.push_back(
"uid"); vals.push_back(uid);
934 cols.push_back(
"enter_time");vals.push_back(curTime.
getString());
937 cols.push_back(
"update_time");vals.push_back(curTime.
getString());
948 if (!(m_writeCxt->
insertRow(m_table, cols, vals, &ser_no, &nullCols)) ) {
957 const std::string& schema) {
972 int errcode = m_man->
build();
975 std::cerr <<
"Error in database description file " << schema
977 std::cerr <<
"Parse failed with error " << errcode << std::endl;
990 std::cout <<
"XML schema and MySQL database are NOT compatible"
994 std::cout <<
"Connection failed while attempting match" << std::endl;
1002 unsigned nCol = cols.size();
1006 for (
unsigned iCol = 0; iCol < nCol; iCol++) {
1008 if (!col->
okValue(vals[iCol])) {
1009 std::cerr <<
"Value " << vals[iCol] <<
" not allowed for column "
1010 << cols[iCol] <<
" in table " << m_table << std::endl;
1018 unsigned nCol = cols.size();
1022 for (
unsigned iCol = 0; iCol < nCol; iCol++) {
1025 std::cerr <<
"Column "
1026 << cols[iCol] <<
" in table " << m_table
1027 <<
" is not nullable" << std::endl;
1035unsigned Metadata::adjustVend(
int newSer) {
1044 std::string serString;
1047 getCols.push_back(
"flavor");
1048 getCols.push_back(
"calib_type");
1049 getCols.push_back(
"completion");
1056 if (!connectWrite(err))
return 0;
1061 FIELDTYPEold, FIELDTYPElit);
1068 results = m_writeCxt->
select(m_table, getCols, orderBy, where);
1074 std::cout << ex.
getMsg();
1079 std::cout <<
"MySQL failure in SELECT" << std::endl;
1083 std::cout <<
"Look-up of serial# " << serString <<
" failed"
1087 std::vector<std::string> fields;
1089 if (fields[2] !=
"OK")
return 0;
1095 std::vector<Assertion::Operator *> conditions;
1096 conditions.reserve(7);
1097 for (
unsigned ix = 0; ix < 5; ix++) {
1100 FIELDTYPEold, FIELDTYPElit));
1105 FIELDTYPEold, FIELDTYPElit));
1109 FIELDTYPEold, FIELDTYPElit));
1117 toUpdate.push_back(
"vend");
1119 newVal.push_back(fields[5]);
1122 toUpdate.push_back(
"update_time");newVal.push_back(curTime.
getString());
1124 unsigned nModified = m_writeCxt->
update(m_table, toUpdate, newVal, where);
std::vector< std::string > StringVector
Simple algorithm to test functioning of "the other" TDS.
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0
std::string getString() const
Return string representation of time, not including nanoseconds;.
static int expandEnvVar(std::string *toExpand, const std::string &openDel=std::string("$("), const std::string &closeDel=std::string(")"))
static int atoi(const std::string &InStr)
converts an std::string to an integer
static int stringToInt(const std::string &InStr)
static const char * itoa(int val, std::string &outStr)
bool nullAllowed() const
Returns true if column may take on value NULL.
bool okValue(const std::string &val, bool set=true) const
virtual ResultHandle * select(const std::string &tableName, const StringVector &getCols, const StringVector &orderCols, const Assertion *where=0, int rowLimit=0, int rowOffset=0)=0
virtual MATCH matchSchema(Rdb *rdb, bool matchDbName=true)=0
virtual unsigned int update(const std::string &tableName, const StringVector &colNames, const StringVector &values, const Assertion *where=0, const StringVector *nullCols=0)=0
virtual bool open(const std::string &host, const std::string &userid, const std::string &password, const std::string &dbName)=0
virtual bool insertRow(const std::string &tableName, const StringVector &colNames, const StringVector &values, int *auto_value=0, const StringVector *nullCols=0)=0
void setInputSource(std::string pname)
void setBuilder(Builder *b)
static Manager * getManager()
virtual std::string getMsg()
Table * getTable(const std::string &name) const
virtual bool getRow(std::vector< std::string > &fields, unsigned int i=0, bool clear=true)=0
virtual unsigned int getNRows() const =0
Return number of rows in results.
Column * getColumnByName(const std::string &name) const
Module implements methods for clients to get generic services.
std::vector< std::string > StringVector