Delphi.Masterpiece.Connections and ini settings

Connection to postgres

Adding ini file, for ex. Domain.Registry.Tests.ini

[HostConnectionSettings.Sections.|sbsmb|.{B3026AF7-6447-438B-897D-835ADBF020AA}.PG]
Ip=localhost
Port=5432
VendorHome=..\libpq
Login=DAF7528291F804C0F9CA0F0C1B8085E51D4AB8AEF226D194
Password=
Name=sbsmb

Connecting in the code

  var LConns := Service<IConnections>(S_FD_PGId);
  FConnection := LConns['sbsmb'];

Watch settings from ini in the code

  var LSettingsPG := Service<ISections<IHostConnectionSetting>>.All.Values;
  var LCount := LSettingsPG.Count;

For Oracle it will be IHostConnectionSetting in spite of IConnectionSetting

This entry was posted in Без рубрики. Bookmark the permalink.