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. fix org.openqa.selenium.NoSuchWindowException when find element on windows8.1 ie11.

    Steps:1.I was able to resolve the issue after adding the site URL under trusted sites of IE. The sam ...

  2. android 事件处理机制之requestDisallowInterceptTouchEvent

    当手指触摸到屏幕时,系统就会调用相应View的onTouchEvent,并传入一系列的action.当有多个层级的View时,在父层级允许的情 况下,这个action会一直向下传递直到遇到最深层的Vi ...

  3. java MVC设计模式

    MVC(Model View Control)模型-视图-控制器 一.MVC与模板概念的理解 MVC本来是存在于Desktop程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC的目的是 ...

  4. Java Socket 模拟HTTP请求

    public static void main(String[] args) { try { String url = "192.168.1.103"; Socket socket ...

  5. 同步内核缓冲区sync、fsync和fdatasync函数

    转自http://www.2cto.com/os/201409/339460.html 同步内核缓冲区 1.缓冲区简介 人生三大错觉之一:在调用函数write()时,我们认为该函数一旦返回,数据便已经 ...

  6. 【英语】Bingo口语笔记(50) - Drop系列

  7. Spring的5种通知

    1.前置通知  Before advice Advice that executes before a join point, but which does not have the ability ...

  8. Android 高仿微信 获取最近刚刚拍照的缩略图 功能实现

    原理其实挺简单的,android 中文件 修改 增加 删除等等 都会在数据库里的某个表里记录下来,你需要的时候 只要迅速的去查找这个表里的值 即可得到你想要的所有信息. 实际上 如果真正理解这个表结构 ...

  9. Android数据库一些源码分析

    对于批量数据插入这种最常见的情况来说,我们来看两种实现方式(两种都用了事务). 下面这种应该是最多人使用的插入数据的方法: public long addByExec(List<Person&g ...

  10. windows下mysql 数据库的导入导出

    1.以.sql方式方式导入导出 http://www.360doc.com/content/11/0114/11/2905268_86441355.shtml 2.以.txt方式导入导出 http:/ ...