Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-A19A1F43-E42B-5FC2-AE58-A7BC67B6733A"><title>Migrating from CommDb to the CommsDat API</title><shortdesc>This section highlights some of the issues in the migration from the CommDb to the CommsDat API. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><p>The CommsDat API replaces CommDb. Users of CommDb do not need to make changes to their code. Symbian OS provides a shim that translates the calls to the CommDb API to calls to the CommsDat API. </p> <p>The CommDb API will be withdrawn in the future. Developers are recommended to migrate to the CommsDat API. </p> <section><title>Removal of the CommDb SQL API</title> <p>The Commdb SQL API is removed. </p> <p>The CommDb API allows tools and applications to select views of database tables that match field values. The CommDb API also allows tools and applications to create new user defined tables in the database at run time. </p> <p>The CommsDat keeps this behaviour. Tools and applications can select sets of records by pattern matching fields in a primed table, record or field object with records in the database. Tools and applications can also use the CommsDat API to define and store user defined records. </p> </section> <section><title>Referring to database elements by Id instead of by
Name</title> <p>The Commdb API has an interface based on column names. This method is not efficient. </p> <p>The CommsDat API allows tools and applications to find elements in the database by numeric id and to provide direct access through mapped data objects. You can continue to find elements in the Comms Database by name. The Nifman API continues to use this method. This method is not recommended, because it is very inefficient. </p> </section> <section><title>Retrieving small amounts of data</title> <p>Tools and applications do not need to simulate the use of a whole view when they use the <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBRecordSet</apiname></xref> <T> class. Tools and applications can use <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>CMDBRecordSet</apiname></xref> <T> objects for data retrieval. </p> </section> <section><title>Use record tags instead of record names in user defined
fields</title> <p>Many CommDb searches are for records by user defined record name. This type of search is not efficient. </p> <p>The use of numeric Ids improves the performance of searches. User defined records can define a record tag field. Tools and applications give this field the unique numeric Id <xref href="GUID-1CDD0B97-8B00-3373-9908-512C9BC1CF51.dita"><apiname>KCDTIdRecordTag</apiname></xref>. Current procedure fills this field with the record Id of the record. This procedure provides backward compatibility with CommdbId. The field value can be any numeric record tag. For example, a <keyword>UID</keyword> value gives a convenient way to link records . </p> <p>See <xref href="GUID-A96ABD2C-A338-58E5-A674-E840B1F53670.dita">Creating a User Defined Table: Tutorial</xref> </p> </section> </conbody></concept>