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.

Categories:
 
CommandType
#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的更多相关文章

  1. 用delphiXE7 dbExpress Framework提供的功能获取数据表信息

    uses +  Data.DBXMetaDataNames procedure TMainForm.Button2Click(Sender: TObject);var  Cmd: TDBXComman ...

  2. DataSnap 多层返回数据集分析FireDAC JSON

    采用服务器返回数据,一种是返回字符串数据例如JSON,跨平台跨语言,任何语言调用都支持兼容,类似WEBService. 第二种是紧密结合c++builder语言,传输DataSet,可以是Client ...

  3. 关于 datasnap Stream的英文博客能容

    转载:http://blogs.embarcadero.com/jimtierney/2009/04/06/31461/ DataSnap Server Method Stream Parameter ...

  4. datasnap服务器支持的参数类型

    可作为参数的类型TDBXWideStringValueTDBXAnsiStringValueTDBXInt16ValueTDBXInt32ValueTDBXInt64ValueTDBXSingleVa ...

  5. DataSnap Server HTTP json格式修改 返回图片

    DataSnap Server HTTP json 格式修改  http://127.0.0.1:8080/datasnap/rest/TServerMethods1/EchoString/hello ...

  6. delphi c++builder JSON 生成与解析 例子

    json,System.JSON,REST.JSON JSON有两种数据结构,对象和数组. 对象在js中表示为“{}”括起来的内容,数据结构为 {key:value,key:value,...} 数组 ...

  7. 客户端如何连接 DataSnap Server 调用服务的方法

    一般http访问的地址是 http://localhost:8099/datasnap/rest/TServerMethods1/EchoString/abc 一.用FDConnection1连接Da ...

  8. 开发DataSnapserver

     在上次的文章中讨论了怎样把传统的Delphi 主从架构应用程序逐渐转换为DataSnap JSONserver.在本篇文章中让我们正式讨论怎样使用Delphi XE开发DataSnap/REST ...

随机推荐

  1. leetcode:Rotate Array

    Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array  ...

  2. 不同浏览器JS获取浏览器高度和宽度

    摘自:http://blog.csdn.net/lai_gb/archive/2009/07/04/4320956.aspx IE中: document.body.clientWidth ==> ...

  3. 【Android】 PopupWindow使用小结

        PopupWindow的很多用法网上比较多,我就不做过多解释了,只说下可能会遇到的问题,以及解决办法: 1.PopupWindow中的listview无响应 这个主要是因为show写在了set ...

  4. POJ 1976 A Mini Locomotive【DP】

    题意:给出一列火车,可以由三个火车头拉,每个火车头最多拉m节车厢(这m节车厢需要保持连续),再给出n节车厢,每节车厢的人数,问最多能够载多少人到终点. 可以转化为三个长度相等的区间去覆盖n个数,使得这 ...

  5. You must SET PASSWORD before executing this statement解决

    [转载] MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决 转载: http://blog.csdn.net/ ...

  6. 51nod 最长递增子序列

    nlogn版最长递增子序列.线段树.(其实常数蛮大的....) #include<iostream> #include<cstring> #include<algorit ...

  7. HDU 5264 pog loves szh I (字符串,水)

    题意:设有两个串A和B,现将B反转,再用插入的形式合成一个串.如:A:abc   B:efg:反转B先,变gfe:作插入,agbfce.现在给出一个串,要求还原出A和B. 思路:扫一遍O(n),串A在 ...

  8. 新版Windows Azure CDN管理门户正式上线

    经过产品团队的不懈努力,新版Windows Azure CDN管理门户在经过了有限开放预览之后,已经正式上线并开放给所有用户. 新版Windows Azure CDN管理门户经过全新的设计,除了在使用 ...

  9. 【解题报告】[动态规划] RQNOJ - PID273 / 马棚问题

    原题地址:http://www.rqnoj.cn/problem/273 题目大意:中文题不说了. 设从第i匹马到第j-1匹马放在一个马棚里得到的系数为f(i,j). 状态表示:dp[i][j]表示前 ...

  10. UVA 11796 - Dog Distance

    题意  两条狗啊,同时跑,,同时结束,各自跑各自的道路,问跑的过程中,他们最大距离和最小距离的差: 方法  恶心一点就是,最大最小距离的求解方法,假设两只狗都只有一条线段要跑,则可以判定在端点处有最大 ...