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 ...
随机推荐
- 2、介绍在TensorFlow当中使用不同的方式创建张量tensor
import tensorflow as tf from tensorflow.python.framework import ops ops.reset_default_graph() #开始一个计 ...
- pthon中的基本运算
格式化输出的三种方式 1.占位符 程序中经常会有这样的场景:要求用户输入信息,然后打印成固定的格式 比如要求用户输入用户名和年龄,然后打印如下格式: my name is xxx,my age is ...
- springMVC的概念
1,完成一次web请求的过程 Web浏览器发起请求 Web服务器接收请求并处理请求,最后产生响应(一般为html).web服务器处理完成后,返回内容给web客户端,客户端对接收的内容进行处理并显示出来 ...
- RT_THREAD之组件学习
CmBacktrace (Cortex Microcontroller Backtrace)是一款针对 ARM Cortex-M 系列 MCU 的错误代码自动追踪.定位,错误原因自动分析的开源库.支持 ...
- 「WC2013」糖果公园
「WC2013」糖果公园 传送门 树上带修莫队板子题. 看懂题意后就是板子题了. 参考代码: #include <algorithm> #include <cstdio> #i ...
- vultr安装kali
前言 很多国内的主机不支持自定义安装系统,且也不方便下载国外资料:),所以需要使用vultr安装kali. 1.上传镜像 镜像地址填这个(我当时的最新版本) https://cdimage.kali. ...
- SQL 查询每组的第一条记录
CREATE TABLE [dbo].[test1]( [program_id] [int] NULL, [person_id] [int] NULL ) ON [PRIMARY] /*查询每组分组中 ...
- netty代理http&https请求
(1)关键代码 package test; import java.security.cert.CertificateException; import javax.net.ssl.SSLExcept ...
- wc、grep 、 cut、paste 和 tr 命令的用法
1 wc 命令 wc 命令是一个统计的工具,主要用来显示文件所包含的行.字和字节数. wc 命令是 word count 的缩写. (1)命令格式 wc [选项] [文件] (2)常用参数 参数 描述 ...
- 【网摘】模仿 placeholder 属性
/*为空时显示 element attribute content*/ .project-task-edit .subtask-body-txt:empty:before { content: att ...