mozIStorageStatementCallback 编辑

The mozIStorageStatementCallback interface represents a callback handler that the Storage API calls with result, error, and completion notifications while handling asynchronous database queries.

storage/public/mozIStorageStatementCallback.idlScriptable Please add a summary to this article.   Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)

Inherits from: nsISupports

Method overview

void handleCompletion(in unsigned short aReason);
void handleError(in mozIStorageError aError);
void handleResult(in mozIStorageResultSet aResultSet);

 

Constants

ConstantValueDescription
REASON_FINISHED0The statement has finished executing normally.
REASON_CANCELED1The statement stopped executing because it was canceled.
REASON_ERROR2The statement stopped executing because an error occurred.

Methods

handleCompletion()

Called when a statement finishes executing.

 void handleCompletion(
   in unsigned short aReason
 );
Parameters
aReason
The reason the statement stopped executing; see the list of possible values in the Constants section.

handleError()

Called when an error occurs while executing a statement. This function may be called more than once with a different storageIError each time for any given asynchronous statement, and handleCompletion will be called once the statement is complete.

 void handleError(
   in mozIStorageError aError
 );
Parameters
aError
A mozIStorageError object describing the error that occurred.

handleResult()

Called when results from the statement are available. Generally, this method will be called several times, each time providing one or more results. Once there are no more results, handleCompletion will be called.

 void handleResult(
   in mozIStorageResultSet aResultSet
 );
Parameters
aResultSet
An mozIStorageResultSet object describing the available results from the statement's execution.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:103 次

字数:4542

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文