9 void sqlfilldb(
int nfiles = 1000)
11 const char *ins =
"INSERT INTO runcatalog VALUES ('%s', %d,"
12 " %d, %d, %d, %10.2f, '%s', '%s', '1997-01-15 20:16:28',"
13 " '1999-01-15 20:16:28', '%s', '%s')";
21 TSQLServer *db = TSQLServer::Connect(
"mysql://localhost/test",
"nobody",
"");
25 res = db->Query(
"DELETE FROM runcatalog");
33 for (
int i = 0; i < nfiles; i++) {
34 sprintf(dataset,
"testrun_%d", i);
35 sprintf(rawfile,
"/v1/data/lead/test/run_%d.root", i);
36 tag = int(gRandom->Rndm()*10.);
37 sprintf(sql, ins, dataset, i, evt, evt+10000, tag, 25.5,
"test",
"lead",
38 rawfile,
"test run dummy data");
49 Double_t rtime = timer.RealTime();
50 Double_t ctime = timer.CpuTime();
52 printf(
"\n%d files in run catalog\n", nfiles);
53 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);