uniGUI之FirDAC(13)
// uses FireDAC.Phys.SQLite 之后, 可不用添加 TFDPhysSQLiteDriverLink //访问SQLite 文件数据库
procedure TMainForm.UniEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = # then
begin
FDQuery1.ExecSQL('INSERT INTO ToDoListTable VALUES( (select max(id)+1 from ToDoListTable),'''+uniEdit1.Text+''',0)');
FDQuery1.Open('select isDone ,aName ,id from ToDoListTable');
FDQuery1.Last;//定位 最后一行 新记录
end;
end;
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 的一个高级特色,就是它支持连接池。它允许在多个会话里,共用同一个数据库连接
uniGUI之FirDAC(13)的更多相关文章
- uniGUI学习汇总
UniGUI之UniLabel(31) uniGUI之自定义JS事件动作ClientEvents(30) uniGUI之文件下载(29) uniGUI之FDQuery(28) uniGUI之UniPo ...
- uniGUI试用笔记(八)
在业务系统中常常使用回车键(Enter)替代Tab键完成焦点跳转,在uniGUI下,可以不用代码,直接使用TUniForm的NavigateKeys进行设置: 其中Next和Prior决定了焦点向下一 ...
- unigui回车代替TAB
unigui回车代替TAB 在业务系统中常常使用回车键(Enter)替代Tab键完成焦点跳转,在uniGUI下,可以不用代码,直接使用TUniForm的NavigateKeys进行设置: 其中Next ...
- uniGUI之uniEdit(23)
主要新加属性: a]EmptyText在没有文本里显示的背景文本. b]作为其他控件的编辑输入控件. c]ClearButton清空按钮 d]左边显示文本 e]回车触发事件CharEOL:=#13 f ...
- UniGUI 之UniDBGrid(05)
UniGUI 之UniDBGrid(05) 目录1]DataSource设置2]显示MEMO类型里的文字3]显示悬浮提示4]显示当前记录及总记录数5]读取所有记录,及分页6]在前面加上序号列7]不显示 ...
- TechEmpower 13轮测试中的ASP.NET Core性能测试
应用性能直接影响到托管服务的成本,因此公司在开发应用时需要格外注意应用所使用的Web框架,初创公司尤其如此.此外,糟糕的应用性能也会影响到用户体验,甚至会因此受到相关搜索引擎的降级处罚.在选择框架时, ...
- .NET平台开源项目速览(13)机器学习组件Accord.NET框架功能介绍
Accord.NET Framework是在AForge.NET项目的基础上封装和进一步开发而来.因为AForge.NET更注重与一些底层和广度,而Accord.NET Framework更注重与机器 ...
- 转:ORA-15186: ASMLIB error function = [asm_open], error = [1], 2009-05-24 13:57:38
转:ORA-15186: ASMLIB error function = [asm_open], error = [1], 2009-05-24 13:57:38http://space.itpub. ...
- IIS启动失败,启动Windows Process Activation Service时,出现错误13:数据无效 ;HTTP 错误 401.2 - Unauthorized 由于身份验证头无效,您无权查看此页
因为修改过管理员账号的密码后重启服务器导致IIS无法启动,出现已下异常 1.解决:"启动Windows Process Activation Service时,出现错误13:数据无效&quo ...
随机推荐
- Java 通过身份证获取生日和性别
/** * 通过身份证号获取生日和性别 * @param identifyNumber * @return */ private String[] getBirthAndSexByIdNo(Strin ...
- Java面向对象private
1. 类 package cn.itcast.day06.demo03; /* 对于基本类型当中的boolean值,Getter方法一定要写成isXxx的形式,而setXxx规则不变. */ publ ...
- Java基础题目
题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子对数为多少? 程序分析:兔子的规律为数列1,1,2,3,5,8, ...
- HYSBZ-2038小Z的袜子
作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿.终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命-- 具体来说,小Z把这N只袜子从1到N编号,然后从 ...
- Python的基础知识,不同于其他编程语言
1.字符串拼接可以不使用+号 name = "this " "is " "a " "string" 2.使用''' ‘’ ...
- Java学习资源 - 其他
http请求HttpServletRequest详解 HttpServletRequest请求转发 高并发场景下的httpClient优化使用 HttpClien高并发请求连接池 - PoolingH ...
- POJ3662 Telephone Lines (dijkstra+二分)
Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncoop ...
- 使用Gogs搭建自己的Git服务--windows
Gogs介绍 官方网站:传送门... 使用Gogs可以搭建一个自己的私有Git服务. 有时候我们有一些有些不想公开的私人小项目或者练习项目,源码想放在GitHub.码云(一直觉得这名字有点蹭知名度)这 ...
- python2.7 安装 Scipy
Numpy.scikit-learn可以直接 pip install xxx 但Scipy不能,在官网找到了安装方法: python -m pip install --user numpy scipy ...
- MySQL忘记密码如何重置
一]进入服务器下,我用的是centos版本 vim /etc/my.cnf 1 vim[二]找到mysqld的部分然后在下面添加上一句代码,意思是跳过密码直接进入,然后保存退出 skip-grant- ...