const char* dbname = "mysql://host.domain/test";
const char* username = "user";
const char* userpass = "pass";
void sqltables()
{
tables_write();
tables_read();
}
void tables_write()
{
if (
f->IsZombie()) {
delete f;
return; }
TH1I*
h1 =
new TH1I(
"histo1",
"histo title", 1000, -4., 4.);
}
}
void tables_read()
{
if (
f->IsZombie()) {
delete f;
return; }
}
cout << "Printout of TList object" << endl;
if (obj!=0) obj->
Print(
"*");
delete obj;
cout << "Printout of TClonesArray object" << endl;
if (obj!=0) obj->
Print(
"*");
delete obj;
cout << "================ TBox QUERY ================ " << endl;
cout <<
f->MakeSelectQuery(TBox::Class()) << endl;
cout << "================ END of TBox QUERY ================ " << endl;
cout << "================== TH1I QUERY ================ " << endl;
cout <<
f->MakeSelectQuery(TH1I::Class()) << endl;
cout << "================ END of TH1I QUERY ================ " << endl;
}
char * Form(const char *fmt,...)
An array of clone (identical) objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this collection.
1-D histogram with an int per channel (see TH1 documentation)}
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void Add(TObject *obj)
Mother of all ROOT objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
@ kSingleKey
write collection with single key
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Access an SQL db via the TFile interface.