RDbDatabase Class Reference

class RDbDatabase

Abstract class providing the functionality of a database.

The source of the database and the implementation characteristics of a particular database are provided by a class derived from RDbDatabase.

DBMS has one such implementation: the store database.

This class is not intended for user derivation.

Note: For functions (i.e. Execute) that take an Sql string, if the string contains a LIKE clause with * (asterisks) wildcard then the characters between them must be no longer than length 255. If only one * exists then the length is taken from the start and to the end of the clause. However, if the clause contains a ? (question mark) wildcard within it then the characters between must be no longer than length 253.

Nested Classes and Structures

Public Member Functions
IMPORT_C TIntAlterTable(const TDesC &, const CDbColSet &)
IMPORT_C TIntBegin()
IMPORT_C voidClose()
IMPORT_C CDbColSet *ColSetL(const TDesC &)
IMPORT_C TIntCommit()
IMPORT_C TIntCompact()
IMPORT_C TIntCreateIndex(const TDesC &, const TDesC &, const CDbKey &)
TInt CreateTable(const TDesC &, const CDbColSet &)
TInt CreateTable(const TDesC &, const CDbColSet &, const CDbKey &)
IMPORT_C TIntDestroy()
IMPORT_C TIntDropIndex(const TDesC &, const TDesC &)
IMPORT_C TIntDropTable(const TDesC &)
IMPORT_C TIntExecute(const TDesC &, TDbTextComparison)
IMPORT_C TBoolInTransaction()
IMPORT_C CDbIndexNames *IndexNamesL(const TDesC &)
IMPORT_C TBoolIsDamaged()
IMPORT_C CDbKey *KeyL(const TDesC &, const TDesC &)
IMPORT_C TIntRecover()
IMPORT_C voidRollback()
IMPORT_C TSizeSize()
IMPORT_C CDbTableNames *TableNamesL()
IMPORT_C TIntUpdateStats()
Private Member Functions
IMPORT_C TIntCreateTable(const TDesC &, const CDbColSet &, const CDbKey *)
Protected Attributes
RDbHandle< CDbDatabase >iDatabase

Member Functions Documentation

AlterTable(const TDesC &, const CDbColSet &)

IMPORT_C TIntAlterTable(const TDesC &aName,
const CDbColSet &aNewDef
)

Parameters

const TDesC & aName
const CDbColSet & aNewDef

Begin()

IMPORT_C TIntBegin()

Close()

IMPORT_C voidClose()

ColSetL(const TDesC &)

IMPORT_C CDbColSet *ColSetL(const TDesC &aName)const

Parameters

const TDesC & aName

Commit()

IMPORT_C TIntCommit()

Compact()

IMPORT_C TIntCompact()

CreateIndex(const TDesC &, const TDesC &, const CDbKey &)

IMPORT_C TIntCreateIndex(const TDesC &aName,
const TDesC &aTable,
const CDbKey &aKey
)

Parameters

const TDesC & aName
const TDesC & aTable
const CDbKey & aKey

CreateTable(const TDesC &, const CDbColSet &)

TInt CreateTable(const TDesC &aName,
const CDbColSet &aDef
)[inline]

Creates a table on the database.

KErrNone The operation has completed successfully; KErrNoMemory, an out of memory condition has occurred; KErrAlreadyExists, a table with that name already exists; KErrArgument, empty column set, duplicated column name, invalid column length; KErrBadName, invalid table name, invalid column name (containing spaces for example); KErrNotSupported, unknown column type, unknown column attributes; KErrPermissionDenied, the caller does not satisfy the relevant database security policies. Note that other system-wide error codes may also be returned.

capability

Note For a secure shared database, the caller must satisfy the schema access policy for the database.

Parameters

const TDesC & aNameTable name.
const CDbColSet & aDefA set of column definitions which describe the table structure.

CreateTable(const TDesC &, const CDbColSet &, const CDbKey &)

TInt CreateTable(const TDesC &aName,
const CDbColSet &aDef,
const CDbKey &aPrimaryKey
)[inline]

Creates a table on the database.

KErrNone The operation has completed successfully; KErrNoMemory, an out of memory condition has occurred; KErrAlreadyExists, a table with that name already exists; KErrArgument, empty column set, duplicated column name, invalid column length; KErrBadName, invalid table name, invalid column name (containing spaces for example); KErrNotSupported, unknown column type, unknown column attributes; KErrPermissionDenied, the caller does not satisfy the relevant database security policies. Note that other system-wide error codes may also be returned.

capability

Note For a secure shared database, the caller must satisfy the schema access policy for the database.

Parameters

const TDesC & aNameTable name.
const CDbColSet & aDefA set of column definitions which describe the table structure.
const CDbKey & aPrimaryKeyPrimary key definition.

CreateTable(const TDesC &, const CDbColSet &, const CDbKey *)

IMPORT_C TIntCreateTable(const TDesC &aName,
const CDbColSet &aColSet,
const CDbKey *aPrimaryKey
)[private]

Parameters

const TDesC & aName
const CDbColSet & aColSet
const CDbKey * aPrimaryKey

Destroy()

IMPORT_C TIntDestroy()

DropIndex(const TDesC &, const TDesC &)

IMPORT_C TIntDropIndex(const TDesC &aName,
const TDesC &aTable
)

Parameters

const TDesC & aName
const TDesC & aTable

DropTable(const TDesC &)

IMPORT_C TIntDropTable(const TDesC &aName)

Parameters

const TDesC & aName

Execute(const TDesC &, TDbTextComparison)

IMPORT_C TIntExecute(const TDesC &aSql,
TDbTextComparisonaComparison = EDbCompareNormal
)

Parameters

const TDesC & aSql
TDbTextComparison aComparison = EDbCompareNormal

InTransaction()

IMPORT_C TBoolInTransaction()const

IndexNamesL(const TDesC &)

IMPORT_C CDbIndexNames *IndexNamesL(const TDesC &aTable)const

Parameters

const TDesC & aTable

IsDamaged()

IMPORT_C TBoolIsDamaged()const

KeyL(const TDesC &, const TDesC &)

IMPORT_C CDbKey *KeyL(const TDesC &aName,
const TDesC &aTable
)const

Parameters

const TDesC & aName
const TDesC & aTable

Recover()

IMPORT_C TIntRecover()

Rollback()

IMPORT_C voidRollback()

Size()

IMPORT_C TSizeSize()const

TableNamesL()

IMPORT_C CDbTableNames *TableNamesL()const

UpdateStats()

IMPORT_C TIntUpdateStats()

Member Data Documentation

RDbHandle< CDbDatabase > iDatabase

RDbHandle< CDbDatabase >iDatabase[protected]