BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-23-2007, 12:12 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Feb 2007
Location: India
Model: 7100v
Carrier: aittel
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Can we delete specific contents of DataBase

Please Login to Remove!

I want to delete some contents of my previously stored data
OR
suppose if I store my vector in data base
synchronized(store)
{
store.setContents(vec1);
store.commit();
}

and after this if i again store a vector suppose
synchronized(store)
{
store.setContents(vec2);
store.commit();
}

then what contents are present in my database ?
1 . Only vec2
2 . Both vec1 and vec2
if both plz tell me the way to delete vec1

Last edited by Rojiwadiya dinesh : 02-23-2007 at 03:36 AM.
Offline  
Old 02-23-2007, 06:33 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

setContents sets the contents of that persistenStore to whatever object you pass it - so in your above scenario the resulting content will be vec2

if you want to wipe data you should use:

PersistentStore.destroyPersistentObject(0x888HASHS TRING588L);
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 02-23-2007, 06:51 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Posts: 181
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you have a vector that is stored in your persistent store and you want to remove a value then remove the value from the vector and store it again.

For example

Code:
void remove(Object o)
{
    vector.remove(o);
    setStore(vector);
}
Offline  
Old 02-23-2007, 08:29 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Feb 2007
Location: India
Model: 7100v
Carrier: aittel
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks !
It is working fine
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.