Home > Back-end >  Who is the elder brothers to know how to use the UniDac TUniConnection connection pool?
Who is the elder brothers to know how to use the UniDac TUniConnection connection pool?

Time:09-29

Refer to

CodePudding user response:

Database attributes and input the Database path and Database file name, also need the Query and the DataSource

CodePudding user response:

Usage and ADO

CodePudding user response:

I made a simple encapsulation layer, with ado about, as follows:

Type
TSMDBParam=record
DbType: TDbType;
Server: string;
Account: a string;
Password: string;
DbName: string;
Port: integer;
end;


The function TSMUniDriver. Conntect () : a Boolean;
The begin
Disconnect ();
Case FDBParam. DbType of
DtMySQL: FConnection. ProviderName:='MySQL';
DtMSSQL: FConnection. ProviderName:='SQL Server;
DtSqlite: FConnection. ProviderName:='SQLite;
end;
FConnection. SpecificOptions. Values: [' UseUnicode]='true';
FConnection. SpecificOptions. Values: [' Direct ']='false';
FConnection. Username:=FDBParam. Account;
FConnection. Password:=FDBParam. Password;
FConnection. Database:=FDBParam. DbName;
FConnection. Server:=FDBParam. Server;
FConnection. Port:=FDBParam. Port;
Try
FConnection. Connect;
Result:=FConnection. Connected;
Except,
Result:=false;
end;
end;

CodePudding user response:

The original poster is the use of the "pool", the answer is how to connect

CodePudding user response:

Attention,,,,
  • Related