×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    280

    Is that possible that rms cannot take some characters for storing?

    I am making s40 app .
    i am parsing data and storing it in vectors (taking one line at a time in string variable and storing it in vector).
    I am using xml parsing.

    Then i am adding data in recordstore. All my data is added successfully. But when i am fetching some records in between are not getting fetched and rest all are working fine.
    When i open the recordstore of those particular records my rms gets corrupted.

    I am not able to find what exactly is the problem. Do my web service url link has some special characters that it is not picking? but i am taking strings.

    here is the link:
    http://tandonindia.com/check.php?user=275
    it is not picking the next 365 records from here on but rest all is fine

    Here is my recordstore adding code
    public void openrms(Vector v) throws RecordStoreFullException, RecordStoreNotFoundException, RecordStoreException
    {
    Vector v1=new Vector();
    Vector v2=new Vector();



    v1=(Vector)v.elementAt(0);
    v2=(Vector)v.elementAt(1);




    if(v1.size()==0 && v2.size()==0)
    {

    System.out.println("sizeeeeeeeeeeeeeeeeee zero");
    System.out.println("in if part");

    }

    else
    {
    System.out.println("in else part");
    byte[] date;
    byte[] thought;


    ByteArrayOutputStream strmBytes = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(strmBytes);
    int i=2004;
    Enumeration e1 = v1.elements();
    Enumeration e2 = v2.elements();


    try{
    while(e1.hasMoreElements()&&e2.hasMoreElements()) {
    RecordStore r=null;

    r=RecordStore.openRecordStore("recordk_date"+i,true);

    System.out.println("DATE"+i+"created");
    RecordStore r1=null;

    r1=RecordStore.openRecordStore("recordk_thought"+i,true);

    System.out.println("THOUGHT"+i+"created");

    if(i==2004)
    {
    for (int n=0; n<274;n++)
    {
    out.writeUTF(e1.nextElement().toString());
    date=strmBytes.toByteArray();
    out.flush();

    r.addRecord(date,0,date.length);
    strmBytes.reset();

    out.writeUTF(e2.nextElement().toString());
    thought=strmBytes.toByteArray();
    out.flush();

    r1.addRecord(thought,0,thought.length);
    strmBytes.reset();

    }
    }
    else{
    if(i>2004&&i%4!=0)
    {

    for (int n=0; n<365;n++)
    {
    if(e1.hasMoreElements()&&e2.hasMoreElements()){
    out.writeUTF(e1.nextElement().toString());
    date=strmBytes.toByteArray();
    out.flush();

    r.addRecord(date,0,date.length);
    strmBytes.reset();

    out.writeUTF(e2.nextElement().toString());
    thought=strmBytes.toByteArray();
    out.flush();

    r1.addRecord(thought,0,thought.length);
    strmBytes.reset();
    }
    }



    }else{

    for (int n=0; n<366;n++)
    {
    if(e1.hasMoreElements()&&e2.hasMoreElements()){
    out.writeUTF(e1.nextElement().toString());
    date=strmBytes.toByteArray();
    out.flush();

    r.addRecord(date,0,date.length);
    strmBytes.reset();
    out.writeUTF(e2.nextElement().toString());
    thought=strmBytes.toByteArray();
    out.flush();

    r1.addRecord( thought,0, thought.length);
    strmBytes.reset();
    }
    }

    }

    }



    System.out.println("number of records in date"+i+"are"+r.getNumRecords());
    System.out.println("number of records in thought"+i+"are"+r1.getNumRecords());

    r.closeRecordStore();
    r1.closeRecordStore();

    i++;

    }//while loop ends


    strmBytes.close();
    out.close();
    }catch(Exception e){
    System.out.println("error"+e.toString());
    }

    }//end of else

    }//end of function

    Whst to do? my 2005 year rms not opening?

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Is that possible that rms cannot take some characters for storing?

    RMS works with Byte Arrays and does not know the concent of characters or strings or any other data type.
    You can store whatever you want within a byte array (just like a binary file) with your own logic & encoding and then retrieve it the same way.
    and while you only included the writing part of your source and your comment suggest you have problem with the reading then i'm guessing you have an exception when reading it so you better debug it.

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    280

    Re: Is that possible that rms cannot take some characters for storing?

    but if there is error in code then all other year database are running fine why only 2005.
    Yes debugging maybe the only option .

Similar Threads

  1. Not storing in database
    By prathi in forum Symbian
    Replies: 0
    Last Post: 2010-12-16, 12:17
  2. Which one to use for storing data
    By mrjayaram in forum Mobile Java General
    Replies: 2
    Last Post: 2010-06-23, 10:10
  3. storing data in RMS
    By elaltaico in forum Mobile Java General
    Replies: 8
    Last Post: 2009-05-29, 17:00
  4. Storing IMSI to txt
    By anwar21387 in forum Symbian
    Replies: 18
    Last Post: 2009-05-28, 07:43
  5. storing settings
    By suckho in forum Symbian
    Replies: 1
    Last Post: 2002-11-11, 13:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×