Changeset 4514 for trunk/MagicSoft/Mars/msql/MSQLServer.cc
- Timestamp:
- 08/05/04 16:13:48 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msql/MSQLServer.cc
r4513 r4514 460 460 } 461 461 462 Bool_t MSQLServer::IsConnected() const 463 { 464 return fType==kIsServer ? fServ->IsConnected() : kFALSE; 465 } 466 467 const char *MSQLServer::GetName() const 468 { 469 switch (fType) 470 { 471 case kIsServer: return Form("%s://%s:%d", fServ->GetDBMS(), fServ->GetHost(), fServ->GetPort()); 472 case kIsDataBase: return GetNameDataBase(); 473 case kIsTable: return GetNameTable(); 474 case kIsColumn: return GetNameColumn(); 475 default: return "n/a"; 476 } 477 } 478 462 479 void MSQLServer::Init(const char *connection, const char *user, const char *password) /*FOLD00*/ 463 480 { 481 fType = kIsZombie; 482 464 483 fServ = TSQLServer::Connect(connection, user, password); 465 484 if (fServ) … … 469 488 } 470 489 else 471 fType = kIsZombie;490 SetBit(kZombie); 472 491 473 492 fList.SetOwner(); … … 479 498 } 480 499 481 MSQLServer::MSQLServer(const char *u) /*FOLD00*/500 MSQLServer::MSQLServer(const char *u) : fType(kIsZombie) /*FOLD00*/ 482 501 { 483 502 TString url(u); … … 488 507 489 508 if (pos1<0 || pos2<0 || pos3<0 || pos1>pos2 || pos2>pos3) 490 return; 509 { 510 SetBit(kZombie); 511 return; 512 } 491 513 492 514 const TString user = url(pos1, pos2-pos1-1); … … 496 518 497 519 Init(url, user, pasw); 498 499 520 } 500 521 … … 502 523 { 503 524 Close(); 504 cout << "Delete: " << GetName() << endl; 525 if (gDebug>0) 526 cout << "Delete: " << GetName() << endl; 505 527 } 506 528
Note:
See TracChangeset
for help on using the changeset viewer.