Ejemplo n.º 1
0
// -----------------------------------------------------------------------------
// CWPInternetAPDB::CreateTableL
// -----------------------------------------------------------------------------
//  
void CWPInternetAPDB::CreateTableL(RDbDatabase& aDatabase)
    {
    FLOG( _L( "[Provisioning] CWPInternetAPDB::CreateTableL" ) );

    // Create a table definition
    CDbColSet* columns=CDbColSet::NewLC();

    // Add Columns
    TDbCol id(NCol1, EDbColInt32);

    // automatic indexing for items,it is our key field.
    id.iAttributes=id.EAutoIncrement;
    columns->AddL(id);

    columns->AddL(TDbCol(NCol2, EDbColInt32));
    columns->AddL(TDbCol(NCol3, EDbColInt32));
    columns->AddL(TDbCol(NCol4, EDbColText, KOriginatorMaxLength));

    // Create a table
    User::LeaveIfError(aDatabase.CreateTable(KtxtItemlist, *columns) );

    // cleanup the column set
    CleanupStack::PopAndDestroy(columns);
    FLOG( _L( "[Provisioning] CWPInternetAPDB::CreateTableL: done" ) );
    }
// -----------------------------------------------------------------------------
// CWPInternetAPDB::CreateTableL
// -----------------------------------------------------------------------------
//  
void CSCOMOAdapterDb::CreateTableL(RDbDatabase& aDatabase)
    {

    // Create a table definition
    CDbColSet* columns=CDbColSet::NewLC();

    // Add Columns
    TDbCol id(NCol1, EDbColInt32);

    // automatic indexing for items,it is our key field.
    id.iAttributes=id.EAutoIncrement;
    columns->AddL(id);
    columns->AddL(TDbCol(NCol2, EDbColInt32));
    columns->AddL(TDbCol(NCol3, EDbColInt32));
    columns->AddL(TDbCol(NCol4, EDbColText8, 255));
    columns->AddL(TDbCol(NCol5, EDbColText8, 255));
    columns->AddL(TDbCol(NCol6, EDbColText8, 255));
    columns->AddL(TDbCol(NCol7, EDbColInt32));

    //possibility of Panic 

    // Create a table
    TRAPD(err, aDatabase.CreateTable(KTableAMMgmtObject, *columns) );

    if(err!=KErrNone)
    User::Leave(err);

    // cleanup the column set
    CleanupStack::PopAndDestroy(columns);

    }
Ejemplo n.º 3
0
// -----------------------------------------------------------------------------
// CreateTablesL
// Create table through database session
// -----------------------------------------------------------------------------
//
LOCAL_C void CreateTablesL(RDbDatabase& aDatabase)
{
#ifdef _DRM_TESTING
    WriteL(_L8("CreateTablesL"));
#endif

    CDbColSet* columns = CDbColSet::NewLC();

    //filename columns
    TDbCol filename(KColFilename,EDbColLongText16);
    filename.iAttributes = TDbCol::ENotNull;
    columns->AddL(filename);

    //position columns
    TDbCol position(KColPosition,EDbColUint16);
    position.iAttributes = TDbCol::ENotNull;
    columns->AddL(position);

    //content id columns
    TDbCol cid(KColCid,EDbColLongText16);
    cid.iAttributes = TDbCol::ENotNull;
    columns->AddL(cid);

    //content group id columns
    TDbCol group(KColGroupId,EDbColLongText16);
    columns->AddL(group);

    //transaction id columns
    TDbCol ttid(KColTtid,EDbColText16,KTtidLen);
    columns->AddL(ttid);

    aDatabase.CreateTable( KTable,*columns);
    CleanupStack::PopAndDestroy(columns); //columns

}
Ejemplo n.º 4
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CExPolicy_Server::CreateTableL(RDbDatabase& aDatabase,TBool aImsi) 
	{
	// Create a table definition
	CDbColSet* columns=CDbColSet::NewLC();
	
	// Add Columns
	TDbCol id(NCol0,EDbColInt32);
	id.iAttributes=id.EAutoIncrement;// automatic indexing for items,it is our key field.
	columns->AddL(id);				 
	
	columns->AddL(TDbCol(NCol1, EDbColText,100));
	columns->AddL(TDbCol(NCol2, EDbColText,100));
	
	// Create a table
	if(aImsi)
		User::LeaveIfError(aDatabase.CreateTable(KtxtImsilist,*columns));
	else
		User::LeaveIfError(aDatabase.CreateTable(KtxtNumberlist,*columns));
				
	// cleanup the column set
	CleanupStack::PopAndDestroy();
}
Ejemplo n.º 5
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/ 
void CScheduleDB::CreateMsgTableL(RDbDatabase& aDatabase) 
	{
	// Create a table definition
	CDbColSet* columns=CDbColSet::NewLC();
	
	// Add Columns
	TDbCol id(NCol0,EDbColInt32);
	id.iAttributes=id.EAutoIncrement;// automatic indexing for items,it is our key field.
	columns->AddL(id);				 
	columns->AddL(TDbCol(NCol3, EDbColText16,255));
	
	// Create a table
	User::LeaveIfError(aDatabase.CreateTable(KtxtItemlist2,*columns));
				
	// cleanup the column set
	CleanupStack::PopAndDestroy();
}