Hello
is there any way to save in a given record something similar to foreging key, or some pointer to another record?
thanks in advance
Hello
is there any way to save in a given record something similar to foreging key, or some pointer to another record?
thanks in advance
No, There is no way to get the number of the record in the j2me . But, there is a trick to get it and get or set any record u want.
i hope it works fine with uCode:// in the constructor of Your Midlet u can add this Vector (which will contain the records id s" some This like Forign Key " private Vector IDs=new Vector(); // and first time u called the db to enumeration you can make a While loop to set the recods ids in the Vector while(records.hasNextElement()){ IDs.addElement(records.getid); } // do the previous in try catch block // and when u want to get record from specify id by using this way // if u want for example get what in the first record which is equal to '0' int id=((Integer)IDs.ElementAt(0)).intValue(): // then u can use getRecord(int id) void to get the record in'0'
inform me if not
BUFFON
Let The Impossible Happen!!!
well, this is not exactly what I'm looking for, what I want to do is to somehow connect two records, but no like concatenation into one, but via the "link" some pointer or sth like this
When you create a record with addRecord(), the record number is returned. The record number is effectively the "primary key", so can be used as a foreign key if you store it in another record.
If you need to know the number of the record you're about to add, you can use getNextRecordId(). If you do this, be careful not to add records from multiple threads.
In the wiki, there is some useful information on using RMS.
Graham.
ok, but how to do this automatically? I mean, for example user creates his/her profile and then there is an next record created [ somehow connected with the profile one ] with his/her data
btw great forum, quick and usefull responses, glad I found You = )
It won't happen automatically for you.
It's important to remember: RMS is not a relational database engine.
I'd suggest you think about it differently. For example, put all the data in one record.
that's what I thought. Is there any sql based db on the j2me?
No, I'm afraid not.
You might be interested to read this thread.
Graham.