#include #include #include "dbclient/KM3NeTDBClient.h" #include "JDB/JDB.hh" #include "JDB/JPersons.hh" #include "JDB/JSelector.hh" #include "JDB/JDBToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to get location ID corresponding to given user login. * \author bjung */ int main(int argc, char **argv) { using namespace std; using namespace JPP; JServer server; string usr; string pwd; string cookie; string login; int debug; try { JParser<> zap("Auxiliary program to get location ID corresponding to given user login."); zap['s'] = make_field(server) = getServernames(); zap['u'] = make_field(usr) = ""; zap['!'] = make_field(pwd) = ""; zap['C'] = make_field(cookie) = ""; zap['L'] = make_field(login) = ""; zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } try { JDB::reset(usr, pwd, cookie); JSelector selector = getSelector(login.empty() ? JDB::get()->User() : login); ResultSet& rs = getResultSet(getTable(), selector); JPersons personalia; rs >> personalia; cout << personalia.LOCATIONID << endl; } catch(const exception& error) { FATAL(error.what() << endl); } }