31 const char *pass,
const char *table)
36 if (!
fDB ||
fDB->IsZombie()) {
43 TString smx =
gEnv->GetValue(
"SQLMonitoringWriter.MaxBulkSize",
"16M");
94 if (!values || (values && values->
GetSize() < 1))
101 while (ops.
Tokenize(op, from,
",")) {
107 Ssiz_t idot = table.Index(
'.');
109 table.Remove(idot+1);
130 while ((o = nxi())) {
131 if (!strncmp(o->
ClassName(),
"TNamed", 6)) {
134 }
else if (!strcmp(o->
ClassName(),
"TParameter<Long64_t>")) {
137 }
else if (!strcmp(o->
ClassName(),
"TParameter<double>")) {
140 }
else if (!strcmp(o->
ClassName(),
"TParameter<float>")) {
143 }
else if (!strcmp(o->
ClassName(),
"TParameter<int>")) {
146 }
else if (!strcmp(o->
ClassName(),
"TParameter<long>")) {
160 if (!(res =
fDB->Query(sql))) {
161 Error(
"SendParameters",
"insert into %s failed", table.Data());
162 if (sql.
Length() > 1024) {
177 Error(
"SendParameters",
"bulk insert: first entry in list is not 'TObjString' but '%s'", o ? o->
ClassName() :
"noclass" );
185 while ((o = nxi())) {
190 Warning(
"SendParameters",
"bulk insert: ignoring not 'TObjString' entry ('%s')", o->
ClassName() );
194 if (!(res =
fDB->Query(sql))) {
195 Error(
"SendParameters",
"bulk insert into %s failed", table.Data());
196 if (sql.
Length() > 1024) {
211 if (!(res =
fDB->Query(sql))) {
212 Error(
"SendParameters",
"bulk insert into %s failed", table.Data());
213 if (sql.
Length() > 1024) {
int Ssiz_t
String size (currently int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
const char * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Named parameter, streamable and storable.
virtual ~TSQLMonitoringWriter()
Destructor.
Bool_t SendParameters(TList *values, const char *) override
Register query log using the information in the list which is in the form TParameter(<par>,...
TSQLMonitoringWriter(const TSQLMonitoringWriter &)=delete
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
The db should be of the form: <dbms>://<host>[:<port>][/<database>], e.g.: mysql://pcroot....
Int_t Atoi() const
Return integer value of string.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
TVirtualMonitoringWriter(const TVirtualMonitoringWriter &)=delete