|
||
class RDbNamedDatabase : public RDbDatabase;
Generic database implementation
RDbDatabase
- Abstract class providing the functionality of a database.
RDbNamedDatabase
- Generic database implementation
Defined in RDbNamedDatabase
:
Create(RDbs &,const TDesC &,const TDesC &)
Creates a secure shared database. Max allowed database name length (with the ext...Create(RFs &,const TDesC &,const TDesC &)
Creates a new non-secure database.EReadOnly
Row navigation and reading are permitted. EReadWrite
Open(RDbs &,const TDesC &,const TDesC &)
Opens an existing shared secure or non-secure database. Max allowed database nam...Open(RFs &,const TDesC &,const TDesC &,TAccess)
Opens an existing non-secure database.Replace(RFs &,const TDesC &,const TDesC &)
Creates a new non-secure database. If a database with the same file name exists,...TAccess
Specifies which operations can be performed on a rowset. Inherited from RDbDatabase
:
AlterTable(const TDesC &,const CDbColSet &)
Alters a table synchronously.Begin()
Begins a transaction.Close()
Closes a database. Commits any pending transaction. Frees the allocated resource...ColSetL(const TDesC &)const
Returns the table definition.Commit()
Commits the current transaction.Compact()
Synchronous database compaction. Compacts the database and returns when complete...CreateIndex(const TDesC &,const TDesC &,const CDbKey &)
Creates an index synchronously.CreateTable(const TDesC &,const CDbColSet &)
Creates a table on the database.CreateTable(const TDesC &,const CDbColSet &,const CDbKey &)
Creates a table on the database.Destroy()
Drops the tables and destroys the database. This handle is closed on successful ...DropIndex(const TDesC &,const TDesC &)
Drops an index synchronously.DropTable(const TDesC &)
Drops a table synchronously.Execute(const TDesC &,TDbTextComparison)
Executes a SQL statement on the database, and returns when it is complete. The a...InTransaction()const
IndexNamesL(const TDesC &)const
Lists the indexes on a table.IsDamaged()const
Reports the damage status of the database. The function checks database indexes ...KeyL(const TDesC &,const TDesC &)const
Returns the index key.Recover()
Synchronous database recovery. RDbDatabase::Recover() will try to rebuild databa...Rollback()
Rollbacks the current transaction.Size()const
Returns the currently available size information for the database. This comprise...TSize
TableNamesL()const
Lists the tables on the database.UpdateStats()
Update any calculated statistics for the database. Note that this can take an ex...iDatabase
Capability: | Security policy note: | For a secure shared database, the caller must satisfy the schema access policy for the database. |
IMPORT_C TInt Create(RDbs &aDbs, const TDesC &aDatabase, const TDesC &aFormat);
Creates a secure shared database. Max allowed database name length (with the extension) is KDbMaxName symbols.
In this "client-server" mode the database can be shared with the other clients.
For creating a non-secure database, see RDbNamedDatabase::Create(RDbs &,const TDesC &,const TDesC &)
, which first argument is a RFs
reference (or RDbNamedDatabase::Replace(RFs &,const TDesC &,const TDesC &)
).
|
|
RDbNamedDatabase::Create(RFs &,const TDesC &,const TDesC &)
Creates a new non-secure database.RDbNamedDatabase::Replace(RFs &,const TDesC &,const TDesC &)
Creates a new non-secure database. If a database with the same file name exists,...IMPORT_C TInt Create(RFs &aFs, const TDesC &aDatabase, const TDesC &aFormat=TPtrC());
Creates a new non-secure database.
In this "single client" mode, the database cannot be shared with the other clients. The database server is not involved in the operations with the database, the client side database library (edbms.dll) will be used. If the database has to be shared, the following example shows how this may be accomplished:
RFs fs;
TInt err = fs.Connect();
<process the error>
_LIT(KDatabaseName, _L("C:\\A.DB"));
RDbNamedDatabase db;
err = db.Create(fs, KDatabaseName); //Step 1 - create the database using the RFs object
<process the error>
db.Close(); //Step 2 - close the database
RDbs dbs;
err = dbs.Connect();
<process the error>
err = db.Open(dbs, KDatabaseName); //Step 3 - reopen the database using the RDbs object
<process the error>
...
Max allowed database name length (with the extension) is KDbMaxName symbols.
For creating a new secure shared database, see RDbNamedDatabase::Create(RDbs &,const TDesC &,const TDesC &)
, which first argument is a RDbs
reference.
|
|
RDbNamedDatabase::Create(RDbs &,const TDesC &,const TDesC &)
Creates a secure shared database. Max allowed database name length (with the ext...IMPORT_C TInt Replace(RFs &aFs, const TDesC &aDatabase, const TDesC &aFormat=TPtrC());
Creates a new non-secure database. If a database with the same file name exists, it will be replased.
In this "single client" mode, the database cannot be shared with the other clients. The database server is not involved in the operations with the database, the client side database library (edbms.dll) will be used. If the database has to be shared, the following example shows how this may be accomplished:
RFs fs;
TInt err = fs.Connect();
<process the error>
_LIT(KDatabaseName, _L("C:\\A.DB"));
RDbNamedDatabase db;
err = db.Replace(fs, KDatabaseName); //Step 1 - create the database using the RFs object
<process the error>
db.Close(); //Step 2 - close the database
RDbs dbs;
err = dbs.Connect();
<process the error>
err = db.Open(dbs, KDatabaseName); //Step 3 - reopen the database using the RDbs object
<process the error>
...
Max allowed database name length (with the extension) is KDbMaxName symbols.
For creating a new secure shared database, see RDbNamedDatabase::Create(RDbs &,const TDesC &,const TDesC &)
, which first argument is a RDbs
reference.
|
|
RDbNamedDatabase::Create(RDbs &,const TDesC &,const TDesC &)
Creates a secure shared database. Max allowed database name length (with the ext...IMPORT_C TInt Open(RFs &aFs, const TDesC &aDatabase, const TDesC &aFormat=TPtrC(), TAccess aMode=EReadWrite);
Opens an existing non-secure database.
In this "single client" mode, the database cannot be shared with the other clients. The database server is not involved in the operations with the database, the client side database library (edbms.dll) will be used.
For opening a new secure shared database, see RDbNamedDatabase::Open(RFs &,const TDesC &,const TDesC &,TAccess)
, which first argument is a RDbs
reference.
|
|
RDbNamedDatabase::Open(RDbs &,const TDesC &,const TDesC &)
Opens an existing shared secure or non-secure database. Max allowed database nam...Capability: | Security policy note: | For a secure shared database, the caller must satisfy the read, the write or the schema access policy for the database. |
IMPORT_C TInt Open(RDbs &aDbs, const TDesC &aDatabase, const TDesC &aFormat=TPtrC());
Opens an existing shared secure or non-secure database. Max allowed database name length (with the extension) is KDbMaxName symbols.
In this "client-server" mode the database can be shared with the other clients.
For opening a single, non-shareable connection to the database, see RDbNamedDatabase::Open(RFs &,const TDesC &,const TDesC &,TAccess)
, which first argument is a RFs
reference.
|
|
RDbNamedDatabase::Open(RFs &,const TDesC &,const TDesC &,TAccess)
Opens an existing non-secure database.TAccess
Specifies which operations can be performed on a rowset.
|