This tutorial demonstrates how TSQLServer can be used to create a connection with a SQlite3 database.
It accesses the Sqlite data base. Download from https://root.cern/files/root_download_stats.sqlite In order to demonstrate the dependency over ROOT version 6.14, this tutorial uses the TSQLResult function which allows to extract the minimum time stored in the SQlite3 database. The next step is to create a TH1F Histogram, which will be filled with the values stored in two different columns from the database, the "Time" and "Version" columns. This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
const char *
minTime =
"SELECT min(Time) FROM accesslog;";
const char *time = "SELECT Time, Version FROM accesslog;";
}
delete row;
}
hTime->GetXaxis()->SetTimeDisplay(1);
hTime->GetXaxis()->SetLabelSize(0.02);
hTime->GetXaxis()->SetTimeFormat(
"%Y-%m-%d");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
1-D histogram with a float per channel (see TH1 documentation)
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....
void SetTimeOffset(Double_t toffset)
Change the time offset for time plotting.
- Author
- Alexandra-Maria Dobrescu 08/2018
Definition in file SQLiteTimeVersionOfRoot.C.