29int main(
int argc, 
char **argv)
 
   47    JParser<> zap(
"Example program to print run related data from data base.");
 
   49    zap[
's'] = 
make_field(server)     = getServernames();
 
   57    zap[
'O'] = 
make_field(option,     
"print UNIX time as TTimeStamp::AsString(<option>)") = 
"";
 
   62  catch(
const exception &error) {
 
   63    FATAL(error.what() << endl);
 
   68    format = getColumns<JRuns>();
 
   73    JDB::reset(usr, pwd, cookie);
 
   75    const int id = getDetector<int>(detid);
 
   79    ResultSet& rs = getResultSet(getTable<JRuns>(), selection);
 
   81    for (
JRuns parameters; selection >> parameters && rs >> parameters; ) {
 
   83      if (TString(parameters.RUNSETUPNAME.c_str()).Contains(regexp)) {
 
   85        for (vector<string>::const_iterator i = format.begin(); i != format.end(); ++i) {
 
   87          if      (option != 
"" && *i == 
"UNIXJOBSTART")
 
   88            cout << 
' ' << TTimeStamp((time_t) (parameters.UNIXJOBSTART /1000)).AsString(option.c_str());
 
   89          else if (option != 
"" && *i == 
"UNIXJOBEND")
 
   90            cout << 
' ' << TTimeStamp((time_t) (parameters.UNIXJOBEND   /1000)).AsString(option.c_str());
 
   92            JRootPrinter::print(cout, parameters, *i);
 
   99  catch(
const exception& error) {
 
  100    FATAL(error.what() << endl);