Auxiliary class for connection to data base.
More...
#include <JDB.hh>
|
static JDB & | get () |
| Get connection to database. More...
|
|
static void | reset () |
| Reset connection to database. More...
|
|
static void | reset (const std::string &usr, const std::string &pwd) |
| Reset connection to database. More...
|
|
static void | reset (const std::string &cookie) |
| Reset connection to database. More...
|
|
static void | reset (const std::string &usr, const std::string &pwd, const std::string &cookie) |
| Reset connection to database. More...
|
|
Auxiliary class for connection to data base.
Definition at line 72 of file JDB.hh.
Default constructor.
Definition at line 185 of file JDB.hh.
JDATABASE::JDB::JDB |
( |
const JDB & |
| ) |
|
|
private |
static JDB& JDATABASE::JDB::get |
( |
| ) |
|
|
inlinestatic |
Get connection to database.
- Returns
- database connection
Definition at line 81 of file JDB.hh.
Auxiliary class for connection to data base.
static void JDATABASE::JDB::reset |
( |
| ) |
|
|
inlinestatic |
Reset connection to database.
Definition at line 92 of file JDB.hh.
96 if (db.
get() != NULL) {
98 static_cast<std::shared_ptr<Client>&
>(db).
reset();
static void reset()
Reset connection to database.
Auxiliary class for connection to data base.
static JDB & get()
Get connection to database.
static void JDATABASE::JDB::reset |
( |
const std::string & |
usr, |
|
|
const std::string & |
pwd |
|
) |
| |
|
inlinestatic |
Reset connection to database.
- Parameters
-
usr | user name |
pwd | pass word |
Definition at line 109 of file JDB.hh.
112 static_cast<std::shared_ptr<Client>&
>(
JDB::get()) = Client::Create(Server::Default, usr.c_str(), pwd.c_str());
static JDB & get()
Get connection to database.
static void JDATABASE::JDB::reset |
( |
const std::string & |
cookie | ) |
|
|
inlinestatic |
Reset connection to database.
- Parameters
-
Definition at line 121 of file JDB.hh.
126 string buffer = cookie;
130 ifstream
in(cookie.c_str());
139 if (pos != string::npos) {
140 buffer.erase(0, pos);
143 static_cast<std::shared_ptr<Client>&
>(
JDB::get()) = Client::Create(Server::Default, buffer.c_str());
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
static const char PREFIX_COOKIE
Cookie prefix.
static JStat getFileStatus
Function object for file status.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
static JDB & get()
Get connection to database.
static void JDATABASE::JDB::reset |
( |
const std::string & |
usr, |
|
|
const std::string & |
pwd, |
|
|
const std::string & |
cookie |
|
) |
| |
|
inlinestatic |
Reset connection to database.
An attempt to make a connection to the database is made in the following order, using:
- user name and password, if neither empty;
- given cookie, if not empty;
- private cookie file (created with JCookie.sh);
- public cookie (defined by environment variable DBCOOKIE);
- Parameters
-
usr | user name |
pwd | password |
cookie | persistent cookie |
Definition at line 161 of file JDB.hh.
168 if (usr !=
"" && pwd !=
"")
170 else if (cookie !=
"")
177 THROW(JDatabaseException,
"Missing user name / password or cookie file.");
static void reset()
Reset connection to database.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
const char * getPrivateCookie()
Get private cookie.
static JStat getFileStatus
Function object for file status.
const char * getPublicCookie()
Get public cookie.
JDB& JDATABASE::JDB::operator= |
( |
const JDB & |
| ) |
|
|
private |
The documentation for this class was generated from the following file: