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 ...
随机推荐
- 安装cloudera
1. 查看selinux状态 $ /usr/sbin/getenforce Enforcing $ /usr/sbin/sestatus SELinux status: enabled SELinux ...
- 事务&视图和索引
一:事务 1.含义:事务是一个不可分割的整体,事务中的多个执行过程,同生共死.要么都执行成功,要么都执行失败. 事务必须具备以下四个属性,(简称:ACID): ①.原子性(Atomicity):事务的 ...
- 20160204.CCPP体系详解(0014天)
程序片段(01):define.h+data.h&data.c+control.h&control.c+view.h&view.c+AI.h&AI.c+main.c 内 ...
- matlab中,在灰度解剖图上叠加阈值图,by by DR. Rajeev Raizada
1.参考 reference 1. tutorial主页:http://www.bcs.rochester.edu/people/raizada/fmri-matlab.htm. 2.speech_b ...
- Linux Shell编程(5):整数运算
http://blog.sina.com.cn/s/blog_6db275da0101asmf.html #!/bin/sh let a=$1+$2 b=$[$1+$2] ((c=$1+$2)) d= ...
- dede调用第一张大图,非缩略图
1.找到include/extend.func.php加入现在函数 function firstimg($str_pic) { $str_sub=substr($str_pic,0,-7)." ...
- webservices上传文件
客户端: ob_clean(); ob_start(); readfile("D:/44.jpg"); $logo = ob_get_clean(); $pararmArr = a ...
- 【英语】Bingo口语笔记(39) - Get系列
- 【英语】Bingo口语笔记(72) - play系列
- 高新服务平台在SUSE系统上重新部署笔录
安装步骤 ./shutdown.sh 停止tomcat (1) 删除 zjgx 目录下 除bbs 和Demos所有目录和文件 (2)上传zjgx0519.zip 到zjgx目录下 (3)unz ...