Ignore:
Timestamp:
08/05/04 16:13:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msql/MSQLServer.cc

    r4513 r4514  
    460460}
    461461
     462Bool_t MSQLServer::IsConnected() const
     463{
     464    return fType==kIsServer ? fServ->IsConnected() : kFALSE;
     465}
     466
     467const 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
    462479void MSQLServer::Init(const char *connection, const char *user, const char *password) /*FOLD00*/
    463480{
     481    fType = kIsZombie;
     482
    464483    fServ = TSQLServer::Connect(connection, user, password);
    465484    if (fServ)
     
    469488    }
    470489    else
    471         fType = kIsZombie;
     490        SetBit(kZombie);
    472491
    473492    fList.SetOwner();
     
    479498}
    480499
    481 MSQLServer::MSQLServer(const char *u) /*FOLD00*/
     500MSQLServer::MSQLServer(const char *u) : fType(kIsZombie) /*FOLD00*/
    482501{
    483502    TString url(u);
     
    488507
    489508    if (pos1<0 || pos2<0 || pos3<0 || pos1>pos2 || pos2>pos3)
    490         return;
     509    {
     510        SetBit(kZombie);
     511        return;
     512    }
    491513
    492514    const TString user = url(pos1, pos2-pos1-1);
     
    496518
    497519    Init(url, user, pasw);
    498 
    499520}
    500521
     
    502523{
    503524    Close();
    504     cout << "Delete: " << GetName() << endl;
     525    if (gDebug>0)
     526        cout << "Delete: " << GetName() << endl;
    505527}
    506528
Note: See TracChangeset for help on using the changeset viewer.