uniGUI之FirDAC(13)
2020-02-05 16:00:40来源:博客园 阅读 ()
uniGUI之FirDAC(13)
In uniGUI, each TFDConnection component must be placed on MainModule or a DataModule created from uniGUI Wizard. It is also possible to create and destroy a common datamodule as part of the constructor and destructor of any TUniForm (because they are also private to its session). This will ensure that each session will have its own private TFDConnection component.
在uniGUI,每个TFDConnection组件必须放在 MainModule或者 由uniGUI Wizard创建的DataModule里。TFDConnection也可创建和销毁公众 datamodule ,作为 TUniForm(因为他们对Session同样是私有的)的constructor 和destructor 。这将确保每个Session将有它自己私有的TFDConnection组件。
In addition to that, we need to place a TFDManager component on the ServerModule and set its Active property to True in ServerModule's OnCreate event.
另外,要放一个TFDManager组件在ServerModule ,在ServerModule的OnCreate 事件里,设置它的Active 属性为True,。
Other components to place on ServerModule are TFDGUIxWaitCursor and TFDPhysXXXDriverLink. TFDPhysXXXDriverLink is the driver link component for your database engine. For MySQL it should be TFDPhysMySQLDriverLink. For TFDGUIxWaitCursor set Provider to Console and ScreenCursor to gcrNone.
其他要放在ServerModule 里的组件有: TFDGUIxWaitCursor 和TFDPhysXXXDriverLink。TFDPhysXXXDriverLink是根据你的数据库类型来的,例如,MySQL就应该为TFDPhysMySQLDriverLink。将TFDGUIxWaitCursor的Provider 设置为Console ,同时 ScreenCursor 设置为gcrNone.。
In the OnCreate event FDManager1.Active should be set to True.
FDManager1的OnCreate 事件里, FDManager1.Active 应该设置为True.
procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin . . FDManager1.Active := True; end;
In similar manner, in the OnDestroy event FDManager1.Close should be called.
类似地,FDManager1的OnDestroy 事件,FDManager1.Close 应被调用。
procedure TUniServerModule.UniGUIServerModuleDestroy(Sender: TObject); begin . . . FDManager1.Close; end;
Pooling Connections 连接池
One of the advanced features in FireDAC is the support for pooled connections. It allows sharing identical database connections among sessions.
FireDAC 的一个高级特色,就是它支持连接池。它允许在多个会话里,共用同一个数据库连接
原文链接:https://www.cnblogs.com/tulater/p/12264271.html
如有疑问请与原作者联系
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- uniGUI学习之UniStringGrid(35) 2020-04-15
- uniGUI之主窗口折叠UI之UniTreeMenu(32-2) 2020-04-14
- uniGUI学习之uniButton图标(34) 2020-04-09
- UniGUI学习之hbox布局(33) 2020-04-08
- uniGUI之自定义JS事件动作ClientEvents(30) 2020-02-19
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash