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;