1 |
//============================================================================ |
//============================================================================ |
2 |
// $Id: PamOffLineSW_Main.cpp,v 1.7 2009/08/05 18:48:43 pam-fi Exp $ |
// $Id: PamOffLineSW_Main.cpp,v 1.8 2009/12/24 10:31:13 mocchiut Exp $ |
3 |
// Description : Pamela Off-Line Software |
// Description : Pamela Off-Line Software |
4 |
//============================================================================ |
//============================================================================ |
5 |
|
|
73 |
{ |
{ |
74 |
const char* db_user = ""; |
const char* db_user = ""; |
75 |
const char* db_pwd = ""; |
const char* db_pwd = ""; |
76 |
char* connection = NULL; |
char* pelosconnection = NULL; |
77 |
//marco_new_01 |
//marco_new_01 |
78 |
bool single_connection=false; |
bool single_connection=false; |
79 |
long int iNumCadres=0; //cadre's number |
long int iNumCadres=0; //cadre's number |
629 |
char *pamdbhost = getenv("PAM_DBHOST"); |
char *pamdbhost = getenv("PAM_DBHOST"); |
630 |
if (pamdbhost) |
if (pamdbhost) |
631 |
{ |
{ |
632 |
connection = pamdbhost; |
pelosconnection = pamdbhost; |
633 |
} |
} |
634 |
else |
else |
635 |
{ |
{ |
648 |
db_name="chewbacca_db"; |
db_name="chewbacca_db"; |
649 |
} |
} |
650 |
sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name); |
sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name); |
651 |
connection=conn; |
pelosconnection=conn; |
652 |
} |
} |
653 |
} |
} |
654 |
else{ |
else{ |
655 |
sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name); |
sprintf(conn,"mysql://%s:%d/%s",db_host,db_port,db_name); |
656 |
connection=conn; |
pelosconnection=conn; |
657 |
} |
} |
658 |
|
|
659 |
if (!strcmp(db_user,"")) |
if (!strcmp(db_user,"")) |
683 |
} |
} |
684 |
} |
} |
685 |
|
|
686 |
string msg = "Using DB: " + string(connection);// +" "+ string(db_user) +" "+ string(db_pwd); |
string msg = "Using DB: " + string(pelosconnection);// +" "+ string(db_user) +" "+ string(db_pwd); |
687 |
mainLogUtil->logAlways(msg); |
mainLogUtil->logAlways(msg); |
688 |
} |
} |
689 |
|
|