TDBXCommand TDBXReader
TDBXCommand *cmd;
cmd= FDBXConnection->CreateCommand();
cmd->CommandType=TDBXCommandTypes_DSServerMethod;
FFindDataSetCommand->Text = "TServerMethods1.FindDataSet";
cmd->Parameters->Parameter[0]->Value->GetDBXReader();
cmd->ExecuteUpdate();
if (FInstanceOwner)
cmd->FreeOnExecute(result);
FreeOnExecute registers the object indicated by Value, and frees it the next time the command is executed, closed, or freed.
#define TDBXCommandTypes_DbxSQL L"Dbx.SQL"
#define TDBXCommandTypes_DbxStoredProcedure L"Dbx.StoredProcedure"
#define TDBXCommandTypes_DbxTable L"Dbx.Table"
#define TDBXCommandTypes_DbxMetaData L"Dbx.MetaData"
#define TDBXCommandTypes_DbxCommand L"Dbx.Command"
#define TDBXCommandTypes_DbxPool L"Dbx.Pool"
#define TDBXCommandTypes_DSServerMethod L"DataSnap.ServerMethod"
TDBXWritableValue* Value;
Value->GetDBXReader();
TDBXReader *reader;
reader =Value->GetDBXReader();
reader= cmd->ExecuteQuery();
TDBXCommand instances can be created by calling one of the TDBXConnection.CreateCommandmethods. As soon as an application is finished using a command, the TDBXCommand.Free method must be called. This releases memory for the command and any associated resources.
TDBXCommand 应用程序会释放内存,内存释放问题泄露问题也不用担心了!
TDBXReader provides a unidirectional reader for a collection of database rows.
TDBXReader provides a forward only reader for a collection of database rows.
TDBXReader is returned by TDBXCommand.ExecuteQuery. Call TDBXReader.Next to access the first and successive rows in the collection. Row values can be accessed using the Value array property. Value is overloaded so it can be indexed either by ordinal position or by column name.
Note: When an application no longer needs a TDBXReader instance, it should call TDBXReader.Free. This ensures that all resources associated with the TDBXReader are released.
可见TDBXReader 比较简单,单向数据集,只有Next方法,没有Prior()方法,没有RecordCount属性。
并且当应用程序不再使用该实例时会自己释放内存这点比较强。解决了内存释放泄露的问题。
做c++builder不用再担心内存释放的问题了。
TDBXCommand TDBXReader的更多相关文章
- 用delphiXE7 dbExpress Framework提供的功能获取数据表信息
uses + Data.DBXMetaDataNames procedure TMainForm.Button2Click(Sender: TObject);var Cmd: TDBXComman ...
- DataSnap 多层返回数据集分析FireDAC JSON
采用服务器返回数据,一种是返回字符串数据例如JSON,跨平台跨语言,任何语言调用都支持兼容,类似WEBService. 第二种是紧密结合c++builder语言,传输DataSet,可以是Client ...
- 关于 datasnap Stream的英文博客能容
转载:http://blogs.embarcadero.com/jimtierney/2009/04/06/31461/ DataSnap Server Method Stream Parameter ...
- datasnap服务器支持的参数类型
可作为参数的类型TDBXWideStringValueTDBXAnsiStringValueTDBXInt16ValueTDBXInt32ValueTDBXInt64ValueTDBXSingleVa ...
- DataSnap Server HTTP json格式修改 返回图片
DataSnap Server HTTP json 格式修改 http://127.0.0.1:8080/datasnap/rest/TServerMethods1/EchoString/hello ...
- delphi c++builder JSON 生成与解析 例子
json,System.JSON,REST.JSON JSON有两种数据结构,对象和数组. 对象在js中表示为“{}”括起来的内容,数据结构为 {key:value,key:value,...} 数组 ...
- 客户端如何连接 DataSnap Server 调用服务的方法
一般http访问的地址是 http://localhost:8099/datasnap/rest/TServerMethods1/EchoString/abc 一.用FDConnection1连接Da ...
- 开发DataSnapserver
在上次的文章中讨论了怎样把传统的Delphi 主从架构应用程序逐渐转换为DataSnap JSONserver.在本篇文章中让我们正式讨论怎样使用Delphi XE开发DataSnap/REST ...
随机推荐
- URAL1057. Amount of Degrees(DP)
1057 简单的数位DP 刚开始全以2进制来算的 后来发现要找最接近x,y值的那个基于b进制的0,1组合 #include <iostream> #include<cstdio&g ...
- 【Todo】Kerberos、OpenSSL、OAuth2.0等一系列验证权限安全相关学习
Kerberos可以先从这一篇开始: http://idior.cnblogs.com/archive/2006/03/20/354027.html
- 漫游Kafka实现篇之分布式
Zookeeper节点标记 当路径中的元素包括在方括号里比如[xyz],则表示xyz表示的值是不固定的,每个可能的值都有一个Zookeeper节点.比如/topics/[topic]表示每个topic ...
- Jenkins+Maven+SVN搭建自动部署、自动测试环境
.打开http://10.3.15.78:8080/jenkins/,第一次进入里面没有数据,我们需要创建job,我们这有2个项目,需要创建2个job.http://10.3.34.163:9890/ ...
- HDU5427
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> us ...
- YouTrack Changing Database Location for EXE Distribution(windows service)
If you have installed YouTrack from EXE Distribution, then the best way to change the database locat ...
- 关于Java接口
1 接口的本质 (1)一组有规则的集合: (2)一定视角上的同类事物的抽象:同类事物的概念是相对的 2 接口与抽象类的区别 (1)java不支持类的多继承,但可以实现多个接口: (2)使用动机:抽象类 ...
- Apache Conf/Vost/xx.conf 文件配置
#监听8086端口Listen 8086 NameVirtualHost *:8086#保持绝对一致 <VirtualHost *:> ServerName localhost Serve ...
- $(function(){})和jQuery(function(){})
$(function(){})和jQuery(function(){})有没有区别,群里的屌丝争吵起来,各自讲着各种理论大道理.但还是有人给出了简而有力的证明: 区分大小写(jQuery) 但jQue ...
- RDoc
RDoc - Ruby Documentation System home github.com/rdoc/rdoc rdoc docs.seattlerb.org/rdoc bugs github. ...