Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: es_sock.h
Link against: esock.lib

Class RNetDatabase

RNetDatabase

Support

Supported from 5.0

Description

Provides an interface to network databases, such as LM-IAS with IrDA, that may be provided by particular protocol modules.

Note the following points before using this class:

Derivation

RNetDatabaseProvides an interface to network databases, such as LM-IAS with IrDA, that may be provided by particular protocol modules
RSubSessionBaseClient-side handle to a sub-session

Defined in RNetDatabase:
Add(), Cancel(), Close(), Open(), Query(), Remove()

Inherited from RSubSessionBase:
CloseSubSession(), CreateSubSession(), Send(), SendReceive(), SubSessionHandle(), operator=()


Opening and closing


Open()

TInt Open(RSocketServ& aSocketServer,TUint anAddrFamily,TUint aProtocol);

Description

Initialises a database access service provided by a particular protocol. It must be called before other object functions are used.

Parameters

RSocketServ& aSocketServer

The socket server session

TUint anAddrFamily

A constant identifying the protocol family

TUint aProtocol

A constant that identifies the protocol that provides the database access service

Return value

TInt

KErrNone if successful otherwise another of the system-wide error codes.


Close()

void Close();

Description

Closes a database access service. If a service has been opened using Open(), then it should be closed using Close(). This will ensure all associated resources are released.

[Top]


Database access


Query()

TInt Query(const TDesC8& aQuery,TDes8& aResult);
void Query(const TDesC8& aQuery,TDes8& aResult,TRequestStatus& aStat);

Description

Makes a query to the database.

Parameters

const TDesC8& aQuery

The query to perform

TDes8& aResult

The result of the query

TRequestStatus& aStat

If specified, indicates asynchronous operation and, on completion, contains an error code: see the system-wide error codes.

Return value

TInt

KErrNone if successful otherwise another of the system-wide error codes.


Add()

TInt Add(const TDesC8& anItem);
void Add(const TDesC8& anItem,TRequestStatus& aStat);

Description

Adds a record to the database.

Parameters

const TDesC8& anItem

The record to add

TRequestStatus& aStat

If specified, indicates asynchronous operation and, on completion, contains an error code: see the system-wide error codes.

Return value

TInt

KErrNone if successful otherwise another of the system-wide error codes.


Remove()

TInt Remove(const TDesC8& anItem);
void Remove(const TDesC8& anItem,TRequestStatus& aStat);

Description

Removes a record from the database.

Parameters

const TDesC8& anItem

The record to remove

TRequestStatus& aStat

If specified, indicates asynchronous operation and, on completion, contains an error code: see the system-wide error codes.

Return value

TInt

KErrNone if successful otherwise another of the system-wide error codes.

[Top]


Cancelling


Cancel()

void Cancel();

Description

Cancels any outstanding asynchronous calls, which will return with error code KErrCancel.