时间:2021-07-01 10:21:17 帮助过:21人阅读
MORMOT数据库连接池
MORMOT封装了一堆的PROPS控件,用于连接各种数据库。
MORMOT的封装是武装到了牙齿的,这堆PROPS控件居然数据库连接池也封装好了。这就为我们省了不少事,笔者非常喜欢!
下面拿TOleDBMSSQLConnectionProperties控件源码为例作说明:
TOleDBMSSQLConnectionProperties = class(TOleDBConnectionProperties)
TOleDBConnectionProperties = class(TSQLDBConnectionPropertiesThreadSafe)
constructor TSQLDBConnectionPropertiesThreadSafe.Create(const aServerName,
aDatabaseName, aUserID, aPassWord: RawUTF8);
begin
fConnectionPool := TObjectList.Create; //PROPS一创建就创建了数据库连接池
fLatestConnectionRetrievedInPool := -1;
InitializeCriticalSection(fConnectionCS);
inherited Create(aServerName,aDatabaseName,aUserID,aPassWord);
end;
MORMOT数据库连接池
标签:cal ldb pass tab mssql reads str ted tco