MozIStorageStatementCallback

  • Revision slug: MozIStorageStatementCallback
  • Revision title: MozIStorageStatementCallback
  • Revision id: 126215
  • Created:
  • Creator: GijsKruitbosch
  • Is current revision? No
  • Comment 30 words added

Revision Content

{{ fx_minversion_header("3") }}

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

{{ InterfaceStatus("mozIStorageStatementCallback", "storage/public/mozIStorageStatementCallback.idl", "unfrozen", "Mozilla 1.9.1", "yes") }}

Inherits from: {{ Interface("nsISupports") }}

Method overview

void handleCompletion(in unsigned short aReason);
void handleError(in {{ interface("mozIStorageError") }} aError);
void handleResult(in {{ interface("mozIStorageResultSet") }} aResultSet);

 

Constants

Constant Value Description
REASON_FINISHED 0 The statement has finished executing normally.
REASON_CANCELED 1 The statement stopped executing because it was canceled.
REASON_ERROR 2 The 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 {{ anch("Constants") }} section.

handleError()

Called when an error occurs while executing a statement.

 void handleError(
   in mozIStorageError aError
 );
Parameters
aError
A {{ interface("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 {{ interface("mozIStorageResultSet") }} object describing the available results from the statement's execution.

See also

  • Storage
  • {{ interface("mozIStorageStatement") }}

Revision Source

<p>{{ fx_minversion_header("3") }}</p>
<p>The <code>mozIStorageStatementCallback</code> interface represents a callback handler that the <a class="internal" href="/en/Storage" title="En/Storage">Storage API</a> calls with result, error, and completion notifications while handling asynchronous database queries.</p>
<p>{{ InterfaceStatus("mozIStorageStatementCallback", "storage/public/mozIStorageStatementCallback.idl", "unfrozen", "Mozilla 1.9.1", "yes") }}</p>
<p>Inherits from: {{ Interface("nsISupports") }}</p>
<h2 id="Method_overview" name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void handleCompletion(in unsigned short aReason);<br> </code></td> </tr> <tr> <td><code>void handleError(in {{ interface("mozIStorageError") }} aError);<br> </code></td> </tr> <tr> <td><code>void handleResult(in {{ interface("mozIStorageResultSet") }} aResultSet);<br> </code></td> </tr> </tbody>
</table>
<p> </p>
<h2 id="Constants">Constants</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Value</td> <td class="header">Description</td> </tr> <tr> <td><code>REASON_FINISHED</code></td> <td>0</td> <td>The statement has finished executing normally.</td> </tr> <tr> <td><code>REASON_CANCELED</code></td> <td>1</td> <td>The statement stopped executing because it was canceled.</td> </tr> <tr> <td><code>REASON_ERROR</code></td> <td>2</td> <td>The statement stopped executing because an error occurred.</td> </tr> </tbody>
</table>
<h2 id="Methods" name="Methods">Methods</h2>
<h3 id="eatCookie.28.29" name="eatCookie.28.29">handleCompletion()</h3>
<p>Called when a statement finishes executing.</p>
<pre class="eval"> void handleCompletion(
   in unsigned short aReason
 );
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl><dt><code>aReason</code> </dt><dd>The reason the statement stopped executing; see the list of possible values in the {{ anch("Constants") }} section. </dd></dl>
<h3 id="eatCookie.28.29" name="eatCookie.28.29">handleError()</h3>
<p>Called when an error occurs while executing a statement.</p>
<pre class="eval"> void handleError(
   in mozIStorageError aError
 );
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl><dt><code>aError</code> </dt><dd>A {{ interface("mozIStorageError") }} object describing the error that occurred. </dd></dl>
<h3 id="eatCookie.28.29" name="eatCookie.28.29">handleResult()</h3>
<p>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.</p>
<pre class="eval"> void handleResult(
   in mozIStorageResultSet aResultSet
 );
</pre>
<h6 id="Parameters" name="Parameters">Parameters</h6>
<dl> <dt><code>aResultSet</code></dt> <dd>An {{ interface("mozIStorageResultSet") }} object describing the available results from the statement's execution.</dd>
</dl><h2 id="See_also">See also</h2>
<ul> <li>Storage</li> <li>{{ interface("mozIStorageStatement") }}</li>
</ul>
Revert to this revision