BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
test_db.C
Go to the documentation of this file.
1
void
test_db
(
TString
strDbHost,
TString
strDbName,
TString
strUserName,
TString
strDbPassword)
2
{
3
TString
conString =
TString::Format
(
"pgsql://%s/%s"
, strDbHost.
Data
(), strDbName.
Data
());
4
TSQLServer
* pSQLServer =
TSQLServer::Connect
(conString, strUserName.
Data
(), strDbPassword.
Data
());
5
if
(pSQLServer ==
nullptr
) {
6
cout <<
"ERROR: database connection was not established ("
<< strDbHost <<
") for '"
<< strUserName <<
"' user"
7
<< endl;
8
return
;
9
}
10
cout <<
"Server info: "
<< pSQLServer->
ServerInfo
() << endl;
11
cout <<
"DB: "
<< pSQLServer->
GetDB
() <<
". Type: "
<< pSQLServer->
GetDBMS
() <<
"."
<< endl;
12
}
TSQLServer
TSQLServer::GetDB
const char * GetDB() const
TSQLServer::GetDBMS
const char * GetDBMS() const
TSQLServer::ServerInfo
virtual const char * ServerInfo()=0
TSQLServer::Connect
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
TString
TString::Data
const char * Data() const
TString::Format
static TString Format(const char *fmt,...)
database
elog_db
macros
test_db.C
Generated on
for BmnRoot by
1.17.0