博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
TDBXCommand TDBXReader
阅读量:7029 次
发布时间:2019-06-28

本文共 1899 字,大约阅读时间需要 6 分钟。

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 .. 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 .. Call TDBXReader. to access the first and successive rows in the collection. Row values can be accessed using the array property. 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不用再担心内存释放的问题了。

转载地址:http://arrxl.baihongyu.com/

你可能感兴趣的文章
List集合三种遍历方法
查看>>
【译】OpenDaylight控制器:YANG Schema和Model
查看>>
C#访问修饰符(public,private,protected,internal,sealed,abstract)
查看>>
android消息线程和消息队列
查看>>
EXCEL中计算不重复单元格的个数
查看>>
二层设备与三层设备的区别--总结
查看>>
安装pytorch成功但cuda不可用
查看>>
unity__DrawCall的理解
查看>>
springboot架构下运用shiro后在configuration,通过@Value获取不到值,总是为null
查看>>
SQLServer 数据库镜像+复制切换方案
查看>>
Postman初探
查看>>
仿淘宝头像上传功能(一)——前端篇。
查看>>
Eclipse通过集成svn实现版本控制
查看>>
OS开发过程中常用开源库
查看>>
关于在多个UItextield切换焦点
查看>>
hdu 2768
查看>>
git记住用户名密码
查看>>
ElasticSearch(2)-安装ElasticSearch
查看>>
从mysql数据表中随机取出一条记录
查看>>
ORACLE 锁表处理,解锁释放session
查看>>