26 printf(
"\nList all databases on server %s\n", db->
GetHost());
28 while ((row = res->Next())) {
29 printf(
"%s\n", row->GetField(0));
35 printf(
"\nList all tables in database \"test\" on server %s\n",
38 while ((row = res->Next())) {
39 printf(
"%s\n", row->GetField(0));
45 printf(
"\nList all columns in table \"runcatalog\" in database \"test\" on server %s\n",
48 while ((row = res->Next())) {
49 printf(
"%s\n", row->GetField(0));
59 const char *sql =
"select dataset,rawfilepath from test.runcatalog " 60 "WHERE tag&(1<<2) AND (run=490001 OR run=300122)";
67 printf(
"\nGot %d rows in result\n", nrows);
69 int nfields = res->GetFieldCount();
70 for (
int i = 0; i < nfields; i++)
71 printf(
"%40s", res->GetFieldName(i));
73 for (
int i = 0; i < nfields*40; i++)
77 for (
int i = 0; i < nrows; i++) {
79 for (
int j = 0; j < nfields; j++) {
80 printf(
"%40s", row->GetField(j));
94 printf(
"\nRealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
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.
virtual TSQLResult * GetDataBases(const char *wild=0)=0
virtual TSQLResult * Query(const char *sql)=0
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void Stop()
Stop the stopwatch.
virtual TSQLResult * GetColumns(const char *dbname, const char *table, const char *wild=0)=0
virtual const char * ServerInfo()=0
const char * GetHost() const
virtual TSQLResult * GetTables(const char *dbname, const char *wild=0)=0
virtual Int_t GetRowCount() const