when db connection down

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
bayufa

when db connection down

Post by bayufa » Mon 18 Apr 2005 01:43

hi

i 'm using dbExpress for my Kylix project . Everything works fine , query , connection , multithread etc . But what surprise me that if db connection down ( i simulate it ) , i can't catch any exceptions . So if this happen , the application will terminate unexpected .

Connection code is pretty simple :

Code: Select all

TSQLConnection * con = new TSQLConnection(Application);
TSQLDataSet * ds = new TSQLDataSet(Application);

con->ConnectionName = "MySQL (Core Lab)";
con->DriverName = "MySQL (Core Lab)";
con->GetDriverFunc = "getSQLDriverMySQL";

con->Params->Clear();
con->Params->Add("DriverName=MySQL (Core Lab)");
con->Params->Add("HostName=" + String(config.db_server));
con->Params->Add("Database=" + String(config.db_name));
con->Params->Add("User_Name=" + String(config.db_user));
con->Params->Add("Password=" + String(config.db_password));
con->Params->Add("BlobSize=-1");

con->LibraryName = "libsqlmda.so.2.50";
con->VendorLib = "libmysql.so";

con->Open();

} catch (EDatabaseError &E)
{
return (0);
} catch (Exception &E)
{
return (0);
} catch (...)
{
return (0);
}
Did i miss something ? please enlight me..
thanks in advance

bayufa

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 19 Apr 2005 08:34

Could you catch an exception using standard driver?

Post Reply