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 The world map is hold by a TH2Poly histogram which, after filling, will show the world wide dispersion of ROOT's users. To histogram filling, is done having as input parameters the two columns of the database: "IPLongitude' - for the longitude, and the
"IPLatitude" - for the latitude.
The data related to the latitude and the longitude has been provided from the
log files storing the users IP.
This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com.
const char *location = "SELECT IPLatitude, IPLongitude FROM accesslog;";
if (!row->GetField(0)[0])
continue;
delete row;
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
2D Histogram with Polygonal Bins
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....
- Author
- Alexandra-Maria Dobrescu 08/2018
Definition in file SQLiteIPLocation.C.