Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
mozISqlConnection Interface Reference

A connection to a SQL database. More...

import "mozISqlConnection.idl";

Inheritance diagram for mozISqlConnection:
Inheritance graph
[legend]
Collaboration diagram for mozISqlConnection:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void init (in AString aHost, in long aPort, in AString aDatabase, in AString aUsername, in AString aPassword)
 Set up the connection.
mozISqlResult executeQuery (in AString aQuery)
 Execute an SQL query synchronously and return the query result.
long executeUpdate (in AString aUpdate)
 Execute an SQL update synchronously and return the number of updated rows.
mozISqlRequest asyncExecuteQuery (in AString aQuery, in nsISupports aContext, in mozISqlRequestObserver aObserver)
 Execute an SQL query asynchronously and return a request.
mozISqlRequest asyncExecuteUpdate (in AString aQuery, in nsISupports aContext, in mozISqlRequestObserver aObserver)
 Execute an SQL update asynchronously and return a request.
void beginTransaction ()
 Begin a transaction.
void commitTransaction ()
 Commit the current transaction.
void rollbackTransaction ()
 Rollback (cancel) the current transaction.
mozISqlResult getPrimaryKeys (in AString aSchema, in AString aTable)
 Return the primary keys of a given table.

Public Attributes

readonly attribute AString serverVersion
 A string holding the name and/or version info of the database.
readonly attribute AString errorMessage
 The most recent error message.
readonly attribute long lastID
 The ID of the most recently added record.

Detailed Description

A connection to a SQL database.

This interface may be further extended by a particular database implementation. The SQL service is responsible for creating and maintaining connections, so there isn't a means to create one directly via this interface.

UNDER_REVIEW

Definition at line 53 of file mozISqlConnection.idl.


Member Function Documentation

mozISqlRequest mozISqlConnection::asyncExecuteQuery ( in AString  aQuery,
in nsISupports  aContext,
in mozISqlRequestObserver  aObserver 
)

Execute an SQL query asynchronously and return a request.

An observer may be used to track when the query has completed.

Parameters:
aQuerythe SQL string of the query to execute
aContextextra argument that will be passed to the observer
aObserverobserver that will be notified when the query is done
Returns:
a request object
mozISqlRequest mozISqlConnection::asyncExecuteUpdate ( in AString  aQuery,
in nsISupports  aContext,
in mozISqlRequestObserver  aObserver 
)

Execute an SQL update asynchronously and return a request.

An observer may be used to track when the query has completed.

Parameters:
aQuerythe SQL string of the update to execute
aContextextra argument that will be passed to the observer
aObserverobserver that will be notified when the update is done
Returns:
a request object

Begin a transaction.

Updates made during the transaction will not be made permanent until it is committed using commitTransaction.

Commit the current transaction.

Execute an SQL query synchronously and return the query result.

Parameters:
aQuerythe SQL string of the query to execute
Returns:
the result of the query

Execute an SQL update synchronously and return the number of updated rows.

Parameters:
aUpdatethe update to execute
Returns:
the result of the query
mozISqlResult mozISqlConnection::getPrimaryKeys ( in AString  aSchema,
in AString  aTable 
)

Return the primary keys of a given table.

Parameters:
aSchemathe schema
aTablethe table name of the keys to retrieve
Returns:
the result which holds the keys
void mozISqlConnection::init ( in AString  aHost,
in long  aPort,
in AString  aDatabase,
in AString  aUsername,
in AString  aPassword 
)

Set up the connection.

This is called by the SQL service. There is no need to call this method directly.

Parameters:
aHostthe host name.
aPortthe port at which the host is listening.
aDatabasethe real database name to connect to.
aUsernamethe username to connect as.
aPasswordthe password to use in authentification phase.

Rollback (cancel) the current transaction.


Member Data Documentation

The most recent error message.

Definition at line 63 of file mozISqlConnection.idl.

The ID of the most recently added record.

Definition at line 68 of file mozISqlConnection.idl.

A string holding the name and/or version info of the database.

Definition at line 58 of file mozISqlConnection.idl.


The documentation for this interface was generated from the following file: